1

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?

asked Dec 27, 2011 at 4:22
1
  • I've tried same approach and can't set font size either. Also tried with html5 style attribute without success... Commented Nov 24, 2013 at 19:51

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

1 Comment

thanks Chase. font size should work I'm told, but at least you've given me an alternative

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.