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
Asked
Active
Viewed 496 times
0
-
Check this link http://jgilfelt.github.io/android-actionbarstylegenerator/ – IntelliJ Amiya Dec 23 '14 at 10:53
-
i got the answer on this link http://stackoverflow.com/questions/16240605/change-action-bar-title-color – user3928711 Dec 23 '14 at 11:10
3 Answers
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