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