Reputation: 7536
I am new to android, and I am developing small android application.In my application one button is there which contains text with multiple lines and with different style of text. I did it in following ways :
<Button
android:id="@+id/downloadButton"
android:layout_width="200px"
android:layout_height="65px"
android:background="@drawable/download_button"
android:textColor="@android:color/white"
android:layout_alignParentLeft="true"
/>
And for displaying text I did following thing:
Button download_button = (Button) findViewById(R.id.downloadButton);
String download_styledText = "<font size='10'color='white'>"
+ "Download" + "</font> " + "<br />"+""+"<font size='7'color='#883e33'>"
+ "Save it now!"+"</font>";
download_button.setText(Html.fromHtml(download_styledText));
everything is working fine the only thing is that My font size property is not working... If I define tags like big or small its working fine but for font size its not giving proper output ... What to do ? Need help ... Thank you ...
Upvotes: 1
Views: 7192
Reputation: 138
as answered here: How to apply font size while rendering HTML code in Android or Java
the font tag as implemented in android does not support size. CSS is not supported in any way either.
Upvotes: 1