android:ems attribute

The meaning of android:ems = "10": 

Refers to setting the width of the corresponding control to a width of 10 characters. When this property is set, the maximum width can only be displayed in a row.

 

  1. <TextView

  2. android:ems="1"

  3. android:layout_width="wrap_content"

  4. android:layout_height="wrap_content"

  5. android:text="Hello world"/>

 

When ems = "1" is set, the display is as follows (same as EditText): 

Note that this attribute will not take effect when android:layout_width="match_parent"

Guess you like

Origin blog.csdn.net/mid_Faker/article/details/108568729