What is android:ems attribute in Edit Text?

Android

Android Problem Overview


> 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?

Android Solutions


Solution 1 - Android

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.

Solution 2 - Android

> 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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChiragView Question on Stackoverflow
Solution 1 - AndroidBoris StrandjevView Answer on Stackoverflow
Solution 2 - AndroidadnealView Answer on Stackoverflow