Android ColorPrimaryDark不作为状态栏颜色提交
我在应用程序中有这两个样式文件,它并没有作为状态栏颜色变为colorPrimaryDark。我正在检查Nexus6,但它不工作。这是我缺少的东西 style.xmlAndroid ColorPrimaryDark不作为状态栏颜色提交,android,android-toolbar,android-appcompat,android-styles,android-statusbar,Android,Android Toolbar,Android Appcompat,Android Styles,Android Statusbar,我在应用程序中有这两个样式文件,它并没有作为状态栏颜色变为colorPrimaryDark。我正在检查Nexus6,但它不工作。这是我缺少的东西 style.xml <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize
<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>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
假的
真的
xml(v21)
假的
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
假的
真的
Menifest-在任何活动中都没有定义主题
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
彩色文件
<color name="colorPrimary">#35734F</color>
<color name="colorPrimaryDark">#35734F</color>
<color name="colorAccent">#D2AB67</color>
35734F
#35734F
#D2AB67
将父项更改为“Theme.AppCompat.Light.NoActionBar”
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
尝试在style.xml(v21)
中添加true
和@android:color/transparent
style.xml
<resources>
<!-- Base application theme. -->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme" parent="AppBaseTheme">
</resources>
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
假的
真的
style.xml(v21)
真的
@android:彩色/透明
post colors xml和清单文件代码现在已更新@Ferdousahamed如果某些活动的状态栏变为白色,您可能需要查看此链接:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme" parent="AppBaseTheme">
</resources>
<resources>
<!-- Base application theme. -->
<!--Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>