With this line
myButton.setText(Html.fromHtml("<font color='red' size='50dp'>First</font><br/><font color='blue' size='20dp'>Second</font>"));
The first line is indeed red, and the second line is blue, but I can't control the font size of either text line, what gives? How can I do it?
-
I've tried same approach and can't set font size either. Also tried with html5 style attribute without success...A. Masson– A. Masson2013年11月24日 19:51:35 +00:00Commented Nov 24, 2013 at 19:51
1 Answer 1
You could try setting the font size of the button to 50dp and using the <small> tag for the text you want to make smaller. Of course, this would not be the exact font size you want.
answered Dec 27, 2011 at 4:29
Chase
11.2k8 gold badges45 silver badges39 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
aez
thanks Chase. font size should work I'm told, but at least you've given me an alternative
default