Android的 - 使用UNI code显示馏分 [英] Android - displaying fractions using unicode
本文介绍了Android的 - 使用UNI code显示馏分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使一小部分:
我用这是一个文本视图,但它不是呈现非常漂亮的:
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.
这篇关于Android的 - 使用UNI code显示馏分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文