首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >白色StatusBar on SplashScreen

白色StatusBar on SplashScreen
EN

Stack Overflow用户
提问于 2016-06-17 18:41:26
回答 1查看 383关注 0票数 1

我已经对此做过研究,但无法回答为什么我的状态条在我的屏幕上是白色的。它在我的MainActivity中工作得很好,根据我的声明,它的主题也是"@style/AppTheme.NoActionBar“。我的splashscreen和mainactivity都有相同的主题。

我希望这个状态条是colorPrimaryDark

styles.xml

代码语言:javascript
复制
<!-- 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.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="RainImage">
    <item name="android:src">@drawable/no_rain</item>
</style>

<style name="BirdImage">
    <item name="android:src">@drawable/one_bird</item>
</style>

AndroidManifest.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>

代码语言:javascript
复制
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
        </intent-filter>
    </activity>

    <activity
        android:name=".SplashScreen"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

EN

回答 1

Stack Overflow用户

发布于 2017-02-17 09:10:40

刚刚通过了styles.xml(v21)文件上的以下代码

代码语言:javascript
复制
<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@color/colorPrimaryDark</item>
</style>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37888294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档