亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

android開發(fā)去除標(biāo)題欄的方法

 更新時間:2021年04月26日 10:46:37   作者:杭州小白  
這篇文章主要介紹了android開發(fā)去除標(biāo)題欄的方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

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)文章

最新評論