Reputation: 407
String = " This is SAMPLE"
I want to increase the size of the SAMPLE alone in String to highlight, but need to be in a single string, this is to set in TextView.
Thanks in Advance.
Upvotes: 1
Views: 2124
Reputation: 7532
You have two options:
1, Format your string in HTML and use HTML.from("Your text");
2, Use spannable. A complete guide can find link here
Upvotes: 0
Reputation: 3288
textView.setText(Html.fromHtml("This is <font color='#707070' size='20'>
SAMPLE</font>"));
Upvotes: 5
Reputation: 13552
I think this is possible if you pass the text as html with your highlighted part enclosed in html <bold>
tag.
Upvotes: 0
Reputation: 5673
Use Html.fromHtml()
in setText()
of TextView
. Supported Html Tags can be found here Html Tags Supported by TextView
Upvotes: 0