Issue
I want to change particular text in textview
,i tried like this,
xml file
<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:paddingRight="30dp"
android:textAllCaps="true"
android:textSize="8sp"
android:textStyle="bold" />
Java file
try {
String first_text = "<font color='#ffcc33'><b>"+"ANDROID"+ "</b></font>";
String second_text = "<font color='#33689C'>"+"MARSHAMLLOW"+ "</font>";
Tv_text.setText(Html.fromHtml(first_text+second_text));
} catch (Exception e) {
e.printStackTrace();
}
what the wrong with this,the text color not changed.give any suggestion.
Solution
if you use modifiers below like this make sure it false state :
android:textAllCaps="true"
runtime u have to set Allcaps="true";
Answered By - MurugananthamS
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.