我怎样才能显示在TextView中的公式 [英] How can I display a formula in TextView

查看:214
本文介绍了我怎样才能显示在TextView中的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何显示这样的字符串在的TextView

How can I display such a string in a TextView.

我尝试了很多,但无法找到解决方案。 我无法显示基值 CHA2DS2-VASC

I tried a lot but cant find the solution. I can't display the base value CHA2DS2-VASc.

推荐答案

我会建议你为这个公式创建HTML字符串并使用的TextView里面显示出来:

I would suggest you to create HTML string for this formula and display it inside the TextView by using:

String formulaString = "<body>CHA<sub>2</sub>DS<sub>2</sub>-VAS<sub>c</sub></body>";
textView.setText(Html.fromHtml(formulaString));

这篇关于我怎样才能显示在TextView中的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆