工具栏背景为深色,我希望文本和后退箭头为白色。我尝试了以下操作,但是没有用。
<style name="Theme.MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryDark">@color/blue_darker</item>
<item name="colorAccent">@color/purple</item>
<!-- item name="android:textColorPrimary">@color/white</item--> // I don't want to set this, changes everywhere.
<item name="android:textColorSecondary">@color/white</item>
<item name="android:toolbarStyle">@style/AppTheme.ToolbarStyle</item>
<item name="toolbarStyle">@style/AppTheme.ToolbarStyle</item>
<item name="drawerArrowStyle">@style/AppTheme.DrawerArrowStyle</item>
</style>
<style name="AppTheme.ToolbarStyle" parent="Base.Widget.AppCompat.Toolbar">
<!--<item name="actionOverflowButtonStyle">@style/AppTheme.OverflowButtonStyle</item>-->
<item name="android:textColor">@color/white</item> // doesn't work
<item name="titleTextAppearance">@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse</item>
<item name="android:titleTextAppearance">@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse</item>
<item name="subtitleTextAppearance">@style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle</item>
</style>
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
到您的<android.support.v7.widget.Toolbar>
; 后退箭头和文本将为白色,如@yubarajpoudel所说。