0

I want to change the text color of my app name that is appearing adjacent to the 3 lines that is used to open and close the drawer. It is black in color and i want to change it to white color, how can i do it any help

user3928711
  • 89
  • 2
  • 11

3 Answers3

1

Try this:

ActionBar ab = getActionBar();
ab.setTitle(Html.fromHtml("<font color='#ffffff'>YourTitleHere </font>"));
max59
  • 606
  • 1
  • 7
  • 16
1

Try setting application or activity theme to

   @android:style/Theme.Holo.Light.DarkActionBar
Hardik Amal
  • 1,283
  • 1
  • 16
  • 23
1

This single line of code will do the job

getActionBar().setTitle(Html.fromHtml("<font color='#ff0000'>The Title</font>"));

This will set red color for your Action Bar title. :)

Try the following as an alternate way. change ActionBarStyle to

   <style name="MyTheme.ActionBarStyle" parent="@style/Widget.Sherlock.ActionBar">
     <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
     <item name="titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
   </style>
Anu
  • 1,884
  • 14
  • 30
  • its working , but i dont want to give the title of my app in hard coded string in the place of title, it is in a variable so can u tell me how to put a varaible inside an html code – user3928711 Dec 23 '14 at 10:22