Pregunta

I am on making a widget layout, I need to display superscript type thing like this, like PM displaying in this picture, I am thinking if there is any tool which acts like superscript. Will appreciate your help.

¿Fue útil?

Solución

You want to use Html#fromHtml and use the HTML < sup > tag. Here is what it will look like if you set the text in a TextView in java:

textView.setText("3:36" + Html.fromHtml("<sup>PM</sup>"));

More info can be found on this SO Post: Subscript and Superscript a String in Android

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top