如何使用Appcelerator对Android材质主题UI元素进行主题化?
有这些有用的信息,一切都很好: 图像也非常有用: 问题是,我希望顶部的栏中有白色或浅灰色。但是,当我将其设置为“android:textColorPrimary”时,顶部栏中的文本为白色,但在所有警报中,例如,也会使其不可见/非常难以阅读 如何将工具栏的文本颜色设置为白色,并以默认文本颜色(深灰色)设置警报消息和其他文本的主题 app/platform/android/res/values中的themeAndroid.xml如下所示如何使用Appcelerator对Android材质主题UI元素进行主题化?,android,user-interface,themes,appcelerator,Android,User Interface,Themes,Appcelerator,有这些有用的信息,一切都很好: 图像也非常有用: 问题是,我希望顶部的栏中有白色或浅灰色。但是,当我将其设置为“android:textColorPrimary”时,顶部栏中的文本为白色,但在所有警报中,例如,也会使其不可见/非常难以阅读 如何将工具栏的文本颜色设置为白色,并以默认文本颜色(深灰色)设置警报消息和其他文本的主题 app/platform/android/res/values中的themeAndroid.xml如下所示 <?xml version="1.0" encodin
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="materialTheme" parent="@style/Theme.AppCompat.Light">
<item name="colorPrimary">#2e7d32</item>
<item name="colorPrimaryDark">#005005</item>
<item name="colorAccent">#80d8ff</item>
<item name="colorSwitchThumbNormal">#49a7cc</item>
<item name="android:colorButtonNormal">#49a7cc</item>
<item name="android:textColorPrimary">#DADADA</item>
<item name="android:spinnerItemStyle">@style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
</style>
#2e7d32
#005005
#80d8ff
#49a7cc
#49a7cc
#达达达
@样式/喷丝板项目
@样式/喷丝头下拉项
如果你想设计actionbar字体的颜色,你需要像这样扩展你的主题:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MyThemeActionbar" parent="Theme.AppCompat">
<item name="colorPrimary">#FF0000</item>
<item name="colorPrimaryDark">#000000</item>
<item name="actionBarStyle">@style/CustomTheme.ActionBarStyle</item>
<item name="actionBarTheme">@style/Theme.ActionBarTheme</item>
<!-- tab -->
<item name="actionBarTabTextStyle">@style/TabStyle</item>
<item name="android:actionBarTabTextStyle">@style/TabStyle</item>
</style>
<style name="Theme.ActionBarTheme" parent="style/Widget.AppCompat.Light.ActionBar">
<!-- actionbar arrow -->
<item name="colorControlNormal">#ffffff</item>
</style>
<style name="CustomTheme.ActionBarStyle" parent="style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<!-- actionbar -->
<item name="elevation">0dp</item>
<item name="android:actionMenuTextColor">#FFFFFF</item>
<item name="android:titleTextStyle">@style/CustomTheme.ActionBar.TitleTextStyle</item>
<item name="titleTextStyle">@style/CustomTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="CustomTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<!-- actionbar font -->
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="TabStyle" parent="style/Widget.AppCompat.Light.ActionBar.TabText">
<!-- tab font -->
<item name="android:textColor">#ffffff</item>
</style>
</resources>
#FF0000
#000000
@style/CustomTheme.ActionBarStyle
@风格/主题
@样式/选项卡样式
@样式/选项卡样式
#ffffff
0dp
#FFFFFF
@style/CustomTheme.ActionBar.TitleTextStyle
@style/CustomTheme.ActionBar.TitleTextStyle
#FFFFFF
#ffffff
然后,您可以将字体颜色和主颜色设置为不同的值,并将其他颜色保留为默认值感谢您提供的有关扩展主题的提示!Works great更改了动作栏中的标题。有没有办法将标签标题的颜色设置为白色?例如,views.xml中的此选项不适用。在上面的示例中添加了制表符字体