下标和上标一个字符串在Android(Subscript and Superscript a String in Android)

编程入门 行业动态 更新时间:2024-10-20 08:00:59
下标和上标一个字符串在Android(Subscript and Superscript a String in Android)

如何用下标或上标打印字符串? 没有外部图书馆可以做到吗? 我希望这可以在Android中的TextView中显示。

How can you print a string with a subscript or superscript? Can you do this without an external library? I want this to display in a TextView in Android.

最满意答案

((TextView)findViewById(R.id.text)).setText(Html.fromHtml("X<sup>2</sup>"));

要么

常见的任务和如何在Android中做他们

((TextView)findViewById(R.id.text)).setText(Html.fromHtml("X<sup>2</sup>"));

or

Common Tasks and How to Do Them in Android

更多推荐

本文发布于:2023-08-05 19:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1439304.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:下标   字符串   上标   Android   Superscript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!