300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > Android全屏 隐藏状态栏和标题栏

Android全屏 隐藏状态栏和标题栏

时间:2021-11-22 08:38:20

相关推荐

Android全屏 隐藏状态栏和标题栏

styles 文件设置如下

<resources> <!-- Base application theme. -->

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

<!-- Customize your theme here. -->

<item name="colorPrimary">@color/colorPrimary</item>

<item name="colorPrimaryDark">@color/colorPrimaryDark</item>

<item name="colorAccent">@color/colorAccent</item>

</style> <style name="AppTheme.NoBar">

<item name="windowNoTitle">true</item>

<item name="android:windowFullscreen">true</item>

</style> </resources>

然后在androidmanifest中调用 在 MainActivity 中调用即可.

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="/apk/res/android" package="com.washcars.jinding.myapplication"> <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/AppTheme"> <activity android:name=".MainActivity" android:theme="@style/AppTheme.NoBar"> <intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application></manifest>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。