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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top