Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
248 views
in Technique[技术] by (71.8m points)

android - I want to change the color of the text of my ActionBar, it's not working

I'm not able to change the color of the text of the action bar, the color of the background is working fine, but not the color of the text.

     <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>

here is the manifest :

 <uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="21" />
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

why don't you do it programmatically

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

actually this set's a random colour..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...