How to create vertically aligned superscript and subscript in TextView

后端 未结 6 885
醉话见心
醉话见心 2020-12-08 22:37

In the example of image below:

\"enter

How can I make both the superscript and

6条回答
  •  渐次进展
    2020-12-08 23:18

    you can also refer my answer in this link Simply use SpannableString that will solve your problem.

     SpannableString styledString = new SpannableString("9-10th STD");
     styledString.setSpan(new SuperscriptSpan(), 4, 6, 0);
     textView.setText(styledString);
    

    and put your android:textAllCaps="false"

提交回复
热议问题