I found reference by googling that led me to think the following would give me 2 lines of text in a button, first line normal size and second line smaller. However it just wraps all the copy and in the same size. any suggestions please? This is the line in my strings.xml
<string name="teststr"> String I am testing\n <small><small>(with a sub comment)</small></small></string>
You can use
myButton.setText(Html.fromHtml("String I am testing<br/><small>(with a sub comment)</small>"));
or to read the string from your strings.xml
myButton.setText(Html.fromHtml(getString(R.string.teststr)));
Remember that you need to use <br/> instead of \n to get a new line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With