如题所述
android:ems = "10" 设置TextView或者Edittext的宽度为10个字符的宽度。当设置该属性后,控件显示的长度就为10个字符的长度,超出的部分将不显示。
温馨提示:答案为网友推荐,仅供参考
第1个回答 2013-08-02
android:ems = "10" 设置TextView或者Edittext的宽度为10个字符的宽度。当设置该属性后,控件显示的长度就为10个字符的长度,超出的部分将不显示。
第2个回答 2015-12-02
android:ems = "10" 设置TextView或者Edittext的宽度为10个字符的宽度。当设置该属性后,控件显示的长度就为10个字符的长度,超出的部分将不显示。
控件android:ems属性
本文地址:
xml中
android:ems属性
,作为EditText
默认生成
的属性,其含义是需要编辑的
字符串长度
。
设置为10时,最多编辑
10个em
,一个em单位是
两个inch
,但是随着自动调整,在Android中
em代表‘M’的数量
。
但是
EditText的属性
,只有在
android:layout_width=“wrap_content”
时,才会显示;
如果是
android:layout_width=“match_parent”
时,则不会有变化。
em参考:
“The em is simply the font size. In an element with a 2in
font, 1em thus means 2in. Expressing sizes, such as margins and
paddings, in em means they are related to the font size, and if the user
has a big font (e.g., on a big screen) or a small font (e.g., on a
handheld device), the sizes will be in proportion. Declarations such as
'text-indent: 1.5em' and 'margin: 1em' are extremely common in CSS.”
ems属性:
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.
控件android:ems属性
本文地址:
xml中
android:ems属性
,作为EditText
默认生成
的属性,其含义是需要编辑的
字符串长度
。
设置为10时,最多编辑
10个em
,一个em单位是
两个inch
,但是随着自动调整,在Android中
em代表‘M’的数量
。
但是
EditText的属性
,只有在
android:layout_width=“wrap_content”
时,才会显示;
如果是
android:layout_width=“match_parent”
时,则不会有变化。
em参考:
“The em is simply the font size. In an element with a 2in
font, 1em thus means 2in. Expressing sizes, such as margins and
paddings, in em means they are related to the font size, and if the user
has a big font (e.g., on a big screen) or a small font (e.g., on a
handheld device), the sizes will be in proportion. Declarations such as
'text-indent: 1.5em' and 'margin: 1em' are extremely common in CSS.”
ems属性:
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.
第3个回答 2016-01-08
宽度为10个字符的宽度
xml中 android:ems属性 ,作为EditText 默认生成 的属性,其含义是需要编辑的 字符串长度 。
设置为10时,最多编辑 10个em ,一个em单位是 两个inch ,但是随着自动调整,在Android中 em代表‘M’的数量 。
但是 EditText的属性 ,只有在 android:layout_width=“wrap_content” 时,才会显示;
如果是 android:layout_width=“match_parent” 时,则不会有变化。
xml中 android:ems属性 ,作为EditText 默认生成 的属性,其含义是需要编辑的 字符串长度 。
设置为10时,最多编辑 10个em ,一个em单位是 两个inch ,但是随着自动调整,在Android中 em代表‘M’的数量 。
但是 EditText的属性 ,只有在 android:layout_width=“wrap_content” 时,才会显示;
如果是 android:layout_width=“match_parent” 时,则不会有变化。
第4个回答 2015-11-15
android:ems = "10" 设置TextView或者Edittext的宽度为10个字符的宽度。当设置该属性后,控件显示的长度就为10个字符的长度,超出的部分将不显示。