pmb
pmb

Reputation: 2327

textview superscript doesn't appear correctly

In my code I want set percent as a superscript of textview and I am using this code

 viewHolder.percent.setText(Html.fromHtml("-" + discount.getPercent() + "<sup>%</sup>"));

And when I run I have this result why?

There is no and padding or margin in my code.

enter image description here

Upvotes: 0

Views: 134

Answers (1)

keshav
keshav

Reputation: 3255

Try this

 viewHolder.percent.setText(Html.fromHtml("-" + discount.getPercent() + "<sup><small>%</small></sup>"));

Upvotes: 1

Related Questions