What is android:ems attribute in Edit Text? [duplicate]
Asked Answered
E

2

182

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"

What does ems mean?

Engedi answered 23/4, 2012 at 5:40 Comment(2)
I am not confident to put it as an answer.. But user kcoppock's answer in this thread might interest you..Sulfurous
same question posted here #7054238Troytroyer
W
151

Taken from: 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 is basically CSS property for font sizes.

Wrier answered 23/4, 2012 at 5:44 Comment(1)
android:ems is the number of 'M' occurrences in a EditText field. it points to its widthShepherd
L
33

An "em" is a typographical unit of width, the width of a wide-ish letter like "m" pronounced "em". Similarly there is an "en". Similarly "en-dash" and "em-dash" for – and —

-Tim Bray

Lenhart answered 23/4, 2012 at 5:44 Comment(2)
I am sorry, I do not know who this Tim is, but the only reference I could find regarding his m-width definition is here: en.wikipedia.org/wiki/… (note the section is called incorrect definitions)Wrier
Just look him up. Here's his Wikipedia page, for example.Lenhart

© 2022 - 2024 — McMap. All rights reserved.