Android - displaying fractions using unicode

前端 未结 1 1818
萌比男神i
萌比男神i 2021-01-16 03:41

I am trying to make a fraction:

I am using this is a text view but it is not rendering very nicely:

\"5\"+\'\\u2044\'+\"9\";

It do

相关标签:
1条回答
  • 2021-01-16 04:13

    Try:

    tv.setText(Html.fromHtml("<sup>5</sup>/<sub>9</sub>"));
    

    Don't know if that will look good, but it's worth a shot. Otherwise, other than the single-glyph fractions like 1/2, I suspect you either will need to go without or render it yourself.

    0 讨论(0)
提交回复
热议问题