Issue
I want to give the rgb color to the application title string in my application string in the resource file I have declared like this,
<string name="app_name">MyApplication</string>
and used it to set the title in manifest file like this,
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="@style/MyTheme"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name">
I want to give different color to My and Application words, rgb(201,89,51) for My and rgb(74,137,174) respectively
How can I do this?
Solution
try this
getActionBar().setTitle(Html.fromHtml("<font color='#ff0000'>My</font><font color='#ff00ff'>Application</font>"));
if you are using appcompact :
getSupportActionBar().setTitle(Html.fromHtml("<font color='#ff0000'>My</font><font color='#ff00ff'>Application</font>"));
Answered By - Nooh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.