3089589

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

最近在学习android,碰到些小问题,记录下来

EditText可以在XML和代码中设置字数限制,在xml中

 

android:maxLength =“50”

在代码中可以

 

editText.setFilters( new  InputFilter[]{ new  InputFilter.LengthFilter( 100 )});

限制其只能输入数字的话可以

 

android:numeric="integer"
posted on 2013-03-26 09:25  liangge0218  阅读(1556)  评论(0编辑  收藏  举报