How to achieve TextView with text like below image:
Below solution provide me thoroug code. Subscript and Superscript a String in Android
How to add String for above image in string.xml?
How to achieve TextView with text like below image:
Below solution provide me thoroug code. Subscript and Superscript a String in Android
How to add String for above image in string.xml?
Have your string defined in strings.xml as follow :
<string name="fourth">4<SUP></SUP></string>
And if you need to call it from code, use :
myTextView.setText(Html.fromHtml(getString(R.string.fourth)));
Try this:
((TextView)findViewById(R.id.text)).setText(Html.fromHtml("4<sup>th</sup>"));