【发布时间】:2016-08-15 20:48:37
【问题描述】:
我正在创建一个 Android 应用,并且我使用此代码自定义了我的操作栏-
action_bar_styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
<style name="Theme.Base" parent="AppTheme">
<item name="android:textColorPrimary">#f1f1f1</item>
<item name="colorPrimary">@color/notesPrimaryBackgroundColor</item>
<item name="colorPrimaryDark">@color/notesSecondaryBackgroundColor</item>
<item name="colorAccent">@color/notesColorBackgroundAccent</item>
<item name="windowActionBar">true</item>
<item name="android:windowNoTitle">false</item>
<item name="android:windowBackground">@color/notesBackgroundColor</item>
</style>
</resources>
colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="notesPrimaryBackgroundColor">#009688</color>
<color name="notesSecondaryBackgroundColor">#004D40</color>
<color name="notesColorBackgroundAccent">#FF9922</color>
<color name="notesBackgroundColor">#FAFAFA</color>
<color name="notesPrimaryTextColor">#FAFAFA</color>
<color name="notesBody">#FAFAFA</color>
<color name="notesCardBody">#EBEBEB</color>
<color name="notesSecondaryTextColor">#656565</color>
<color name="notesDropBoxSeparator">#C1C1C1</color>
<color name="notesSelectionTickColor">#455EDE</color>
<color name="notesImageBackground">#C1C1C1</color>
</resources>
我在 Android Manifest 中选择了 Theme.Base 作为主题,并且操作栏颜色显示在设计器中,但是当我在三星平板电脑上运行我的应用程序时,操作栏是白色的,其他一切正常。这可能是因为我在其他地方也指定了操作栏颜色,还是因为我没有正确指定它的颜色?还有其他想法吗?
【问题讨论】:
标签: android xml colors android-actionbar