Android and android Official Website

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.