我正在使用导航抽屉将这些样式用于活动:
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">#03a5e7</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:actionBarStyle">@style/AppTheme.ActionBarStyle</item>
<item name="android:actionMenuTextColor">@color/text_white_color</item>
<item name="android:titleTextStyle">@style/TitleTextStyle</item>
</style>
<style name="AppTheme.ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:titleTextStyle">@style/AppTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="AppTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@color/text_white_color</item>
</style>
我的颜色:
<color name="text_white_color">#FFFFFF</color>
我的AndroidManifest.xml:
<activity
android:name=".ui.activities.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
然而,NavigationDrawer的标题颜色是黑色的。是什么原因 ?
答案 0 :(得分:0)
我已经通过设置
解决了这个问题 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#03a5e7</item>
<item name="android:actionBarStyle">@style/AppTheme.ActionBarStyle</item>
<item name="android:actionMenuTextColor">@color/text_white_color</item>
<item name="android:titleTextStyle">@style/TitleTextStyle</item>
</style>
事情是设置DarkActionBar