maxlength的作用就是直接限制显示的长度,

android:ems    设置TextView的宽度为N个字符的宽度。但是名字很奇怪。

 [java] view plain copy

  1. /** 
  2.  * Makes the TextView exactly this many ems wide 
  3.  * 
  4.  * @attr ref android.R.styleable#TextView_ems 
  5.  */  
  6. @android.view.RemotableViewMethod  
  7. public void setEms(int ems) {  
  8.     mMaxWidth = mMinWidth = ems;  
  9.     mMaxWidthMode = mMinWidthMode = EMS;  
  10.   
  11.     requestLayout();  
  12.     invalidate();  
  13. }  

 

[html] view plain copy
  1. An em is a unit in the field of typography  

 

em是一个印刷排版的单位,表示字宽的单位。 em字面意思为:equal M   (和M字符一致的宽度为一个单位)简称em。

 ems是em的复数表达。


更多相关文章

  1. Android(安卓)TextUtils.isEmpty()的认知
  2. Android(安卓)使用 TableLayout 布局拉伸宽度
  3. Android实现圆形图片
  4. Android(安卓)(DiskLruCache)硬盘缓存代码实现
  5. Android中读取中文字符的文件与文件读取相关
  6. android实现xml数据的解析
  7. Android之判断时间是否为今天
  8. Android(安卓)通过字符串来获取R下面资源的ID 值
  9. android中的格式化字符串

随机推荐

  1. Android(安卓)WebView H5页面 input type
  2. Android(安卓)recovery工作原理
  3. Android(安卓)- 小问题 - ViewPager onPa
  4. AndroidStudio使用Git发布与更新,同步,关
  5. Android(安卓)ViewDragHelper
  6. Android(安卓)差分包制作
  7. Android的eclipse插件adt无法启动“No ta
  8. Android锁屏(四)
  9. Ubuntu 18.04 环境下编译Android(安卓)源
  10. android 开发文档翻译