我有一个应用程序Theme.AppCompat.Light
,我需要使用它,所以Dialogs有轻主题.但这会使我的工具栏中的文字变黑,我宁愿它变成白色.我试过设置工具栏的具体app:theme
到AppCompat.Dark.Actionbar
,但没有运气...我搜索了一段时间,但没有找到一个具体的问题和答案.
这是我的默认AppTheme:
这是我的toolbar.xml:
reVerse.. 17
要更改标题中的标题颜色,Toolbar
只需将属性添加android:textColorPrimary
到工具栏样式即可.
有关工具栏的更多属性,请参阅以下示例.
要更改标题中的标题颜色,Toolbar
只需将属性添加android:textColorPrimary
到工具栏样式即可.
有关工具栏的更多属性,请参阅以下示例.
<style name="MyToolbarStyle" parent="ThemeOverlay.AppCompat.ActionBar"> <!-- Used to for the title of the Toolbar --> <item name="android:textColorPrimary">#fff</item> <!-- Used to for the title of the Toolbar when parent is Theme.AppCompat.Light --> <item name="android:textColorPrimaryInverse">#fff</item> <!-- Used to color the text of the action menu icons --> <item name="android:textColorSecondary">#fff</item> <!-- Used to color the overflow menu icon --> <item name="actionMenuTextColor">#fff</item> <!-- Color of the Toolbar --> <item name="android:background">#455a64</item> </style>