Android的TextView中的下标被剪掉 [英] Android TextView's subscript being clipped off

查看:524
本文介绍了Android的TextView中的下标被剪掉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

而Android的TextView剪辑掉我的文字标(见图片下方),甚至当我使用安卓layout_height =WRAP_CONTENT的TextView的。 是否有固定/变通此?

The Android TextView clips off my text subscripts (see image below) even when I use android:layout_height="wrap_content" for the TextView. Is there a fix/work-around for this?

P / S:上标做工精细

P/S: Superscripts work fine

注意:填充不起作用。

  • 在我试过,甚至加入填充的 50dip 的,但它并没有帮助。
  • 我可以用一个绝对的高度,如 50dip 的但是这一切都弄乱了,当我需要的文字环绕。
  • I tried even adding a padding of 50dip but it did not help.
  • I can use an absolute height such as 50dip but that messes everything up when I need text to wrap around.

样品code:

mtTextView.setText(Html.fromHtml(HC0<副> 3'; /子>));

推荐答案

这个解决方案为我工作。

上标文本通常是由更小的时候,浏览器呈现它,似乎并没有出现在这里,所以你可以复制的(解决这个问题)通过执行此操作:

Superscripted text is usually made smaller when the browser renders it, that doesn't seem to happen here so you can replicate that (and solve this problem) by doing this:

someTextView.setText(Html.fromHtml("Some text<sup><small>1</small></sup>"));

这篇关于Android的TextView中的下标被剪掉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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