Android的 - 使用UNI code显示馏分馏分、Android、UNI、code

2023-09-07 03:00:14 作者:你是我情人i

我想使一小部分:

我用这是一个文本视图,但它不是呈现非常漂亮的:

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

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

它不把文成一个漂亮的分数排序,而不是它涵盖了数字的一部分,squishes在一起。

It does not turn the text into a nice fraction instead it sort of covers part of the numbers and squishes them together.

任何解决方案或替代办法?

Any solutions or alternatives?

推荐答案

尝试:

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

不知道这是否会好看,但它是值得一试。否则,比单字形分数如同1/2等,我怀疑你要么需要去无或使其自己。

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.