문제

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

도움이 되었습니까?

해결책

Try this

 viewHolder.percent.setText(Html.fromHtml("-" + discount.getPercent() + "<sup><small>%</small></sup>"));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top