Android and android Official Website
Controls android: EMS Properties
Address: http://blog.csdn.net/caroline_wendy
In xml
Android: EMS attributesAs EditText
Generated by defaultThe meaning of the attribute is to be edited.
String Length. When set to 10, you can edit up
10 em, An em unit is
Two inchBut with the automatic adjustment, in Android
Em indicates the number of 'M'. However
EditText attributes, Only
Android: layout_width = "wrap_content"Is displayed.
Android: layout_width = "match_parent"Will not change.
Em reference: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."
EMS attribute reference:Reference: http://stackoverflow.com/questions/7053738/what-is-meant-by-ems-android-textviewandroid: 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.