我想改变我的动作条的文本的颜色,它不工作(I want to change the color of

2019-10-21 18:00发布

我不能够改变操作栏的文本的颜色,背景颜色是工作的罚款,而不是文本的颜色。

     <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <item name="android:titleTextStyle">@style/myTheme.ActionBar.Text</item>
</style>

<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">#0E2F44</item>
</style>

  <style name="myTheme.ActionBar.Text" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/actionBarText</item>
</style>

这里是清单:

 <uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="21" />

Answer 1:

你为什么不这样做编程

Random rnd = new Random(); 
ToolBar.setTitleTextColor(Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)));

其实这一套是一个随机的颜色..



文章来源: I want to change the color of the text of my ActionBar, it's not working