android:ems 属性

来源:互联网 发布:淘宝有个雪山狗粮真假 编辑:程序博客网 时间:2024/05/21 07:51

android:ems = "10" 的含义 : 

指的是将对应的控件宽度设为10个字符的宽度。当设置该属性后,一行中最大只能显示设置的宽度。


<TextView    android:ems="1"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:text="Hello world"/>


当设置 ems = "1" 时,显示如下 (EditText 同理): 

注意,当 android:layout_width="match_parent" 时该属性不会生效


2 0
原创粉丝点击