android開發(fā)去除標(biāo)題欄的方法
1:新建一個(gè)項(xiàng)目運(yùn)行起來(lái),可以看到頂部一直有個(gè)標(biāo)題欄看著不是很美觀

2:有兩種方法可以去除頂部標(biāo)題欄
(1)將代碼中AndroidManifest里android:theme="@style/Theme.MyApplication"改為android:theme="@style/Theme.AppCompat.NoActionBar">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
>
(2)在themes.xml文件里改,選中MyApplication,Ctrl+鼠標(biāo)點(diǎn)擊

來(lái)到themes.xml文件里,把代碼中parent="Theme.MaterialComponents.DayNight.DarkActionBar"替換為
parent=“Theme.AppCompat.Light.NoActionBar”
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
3:效果展示

到此這篇關(guān)于android開發(fā)去除標(biāo)題欄的文章就介紹到這了,更多相關(guān)android去除標(biāo)題欄內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
android調(diào)用web service(cxf)實(shí)例應(yīng)用詳解
Google為ndroid平臺(tái)開發(fā)Web Service提供了支持,提供了Ksoap2-android相關(guān)架包接下來(lái)介紹android調(diào)用web service(cxf),感興趣的朋友可以了解下2013-01-01
Android雙重SurfaceView實(shí)現(xiàn)彈幕效果
這篇文章主要為大家詳細(xì)介紹了Android雙重SurfaceView實(shí)現(xiàn)彈幕效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-11-11
Android UI設(shè)計(jì)與開發(fā)之ViewPager介紹和簡(jiǎn)單實(shí)現(xiàn)引導(dǎo)界面
這篇文章主要為大家詳細(xì)介紹了Android UI設(shè)計(jì)與開發(fā)之ViewPager介紹和簡(jiǎn)單實(shí)現(xiàn)引導(dǎo)界面,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-08-08
Android實(shí)現(xiàn)Gesture手勢(shì)識(shí)別用法分析
這篇文章主要介紹了Android實(shí)現(xiàn)Gesture手勢(shì)識(shí)別用法,結(jié)合實(shí)例形式較為詳細(xì)的分析了Android基于Gesture實(shí)現(xiàn)手勢(shì)識(shí)別的原理與具體實(shí)現(xiàn)技巧,需要的朋友可以參考下2016-09-09
Android實(shí)現(xiàn)底部半透明彈出框PopUpWindow效果
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)底部半透明彈出框PopUpWindow效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-07-07
Android RxJava創(chuàng)建操作符Interval
這篇文章主要為大家詳細(xì)介紹了Android RxJava創(chuàng)建操作符Interval的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-12-12
android studio開發(fā)實(shí)現(xiàn)APP開機(jī)自啟動(dòng)
這篇文章主要為大家詳細(xì)介紹了android studio開發(fā)實(shí)現(xiàn)APP開機(jī)自啟動(dòng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-05-05
Android開發(fā)中實(shí)現(xiàn)應(yīng)用的前后臺(tái)切換效果
這篇文章主要介紹了Android開發(fā)中實(shí)現(xiàn)應(yīng)用的前后臺(tái)切換效果的方法,文章最后還附帶了監(jiān)聽程序是否進(jìn)入后臺(tái)的判斷方法,需要的朋友可以參考下2016-02-02

