何谓埃姆斯? (安卓的TextView) [英] What is meant by Ems? (Android TextView)

查看:123
本文介绍了何谓埃姆斯? (安卓的TextView)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是用EMS的意思(与一个TextView)?例如,在

 机器人:EMS setEms(INT)
 

  

让TextView的恰好是这么多的EMS宽。

解决方案

机器人:EMS setEms(N)设置一个TextView的宽度,无论实际文本扩展和文本大小,以适应n个M字母的文字。参见维基百科 em单位

但只有当 layout_width 设置为WRAP_CONTENT。其他 layout_width 值覆盖EMS宽度设置。

添加安卓TEXTSIZE 属性决定的视图n的文本TEXTSIZE *长度的物理宽度'M的上面设置。

What is meant by Ems (related to a TextView)? For example in

android:ems     setEms(int)

Makes the TextView be exactly this many ems wide.

解决方案

android:ems or setEms(n) sets the width of a TextView to fit a text of n 'M' letters regardless of the actual text extension and text size. See wikipedia Em unit

but only when the layout_width is set to "wrap_content". Other layout_width values override the ems width setting.

Adding an android:textSize attribute determines the physical width of the view to the textSize * length of a text of n 'M's set above.

这篇关于何谓埃姆斯? (安卓的TextView)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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