什么是编辑文本中的 android:ems 属性?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10275348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is android:ems attribute in Edit Text?
提问by Chirag
Possible Duplicate:
What means Ems? (Android TextView)
In EditText
there is an attribute named android:ems
. The description
is "Makes the EditText
be exactly this many ems wide"
其中EditText
有一个名为android:ems
. 描述是“使EditText
宽度正好有这么多 em”
What does ems mean?
ems是什么意思?
采纳答案by Boris Strandjev
Taken from: http://www.w3.org/Style/Examples/007/units:
取自:http: //www.w3.org/Style/Examples/007/units:
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.
em 只是字体大小。在具有 2in 字体的元素中,1em 因此意味着 2in。em 中表示边距和内边距等大小,表示它们与字体大小有关,如果用户有大字体(例如,在大屏幕上)或小字体(例如,在手持设备上),大小将成比例。诸如 'text-indent: 1.5em' 和 'margin: 1em' 之类的声明在 CSS 中极为常见。
em
is basically CSS property for font sizes.
em
基本上是字体大小的 CSS 属性。