最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

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

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開(kāi)發(fā)去除標(biāo)題欄的文章就介紹到這了,更多相關(guān)android去除標(biāo)題欄內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

隆安县| 从江县| 建始县| 云浮市| 阳信县| 托克逊县| 旬阳县| 滕州市| 定边县| 临城县| 泰宁县| 洛扎县| 宜兰县| 正镶白旗| 武宁县| 雅安市| 平果县| 黄石市| 安远县| 通城县| 巴东县| 阳谷县| 河津市| 宁晋县| 弥勒县| 揭阳市| 潍坊市| 鹿泉市| 错那县| 南通市| 忻州市| 普安县| 成武县| 大宁县| 石棉县| 通化市| 什邡市| 图们市| 台东县| 万年县| 天津市|