1

I am working with android textview. I need print subscript under superscript.

This is my code:

<string name="abc">Text<sup>supertext</sup><sub>subtext</sub></string>

And this is what i get:

Textsuertextsubtext

But i need something like:

enter image description here

Is it possible to do that only in XML without using java?

  • 2
    Possible duplicate of [How to create vertically aligned superscript and subscript in TextView](http://stackoverflow.com/questions/23990381/how-to-create-vertically-aligned-superscript-and-subscript-in-textview) – Mark Cidade Jan 05 '17 at 20:24
  • 1
    I forgot to ask if it is possible to do that without java... I am sorry... – Juraj Majerech Jan 05 '17 at 20:31
  • Not really. It's just HTML; in order to do this with plain old HTML you'd have to mess with CSS to do it, and even then, ew. I think you'd be better off creating a custom control of some sort. – Dave Newton Jan 05 '17 at 20:34

1 Answers1

-1

You could use 2 text views. One with "Text" and next to it a multi line text view with "Supertext...".

However only do that if it's not strings that may ever be translated.

darrenp
  • 154
  • 1
  • 6