如何显示在TextView的Android中

问题描述:

多项式如何显示的多项式中的TextView像下面如何显示在TextView的Android中

X + X + X = C

Android中

你可以使用spannable。

TextView textView; 
textView.setText(Html.fromHtml("x<sup>3</sup> + x<sup>2</sup> + x = c")); 

另一种方法是使用UTF-8连同能够UTF-8的字体,你可以简单地使用UTF-8字符标。与上标字符的表格可以在这里找到:http://www.unicode.org/charts/直接链接到表上标为:http://www.unicode.org/charts/PDF/U2070.pdf

可以使用<sup><sub>标签在XML做这件事。 看看这个: http://thinkandroid.wordpress.com/2009/12/28/quickly-add-superscript-subscript/

+0

谢谢城市。我只是想出了它。 –