最近在学习android,碰到些小问题,记录下来
EditText可以在XML和代码中设置字数限制,在xml中
android:maxLength =“50”
在代码中可以
editText.setFilters( new InputFilter[]{ new InputFilter.LengthFilter( 100 )});
限制其只能输入数字的话可以
android:numeric="integer"
最近在学习android,碰到些小问题,记录下来
EditText可以在XML和代码中设置字数限制,在xml中
android:maxLength =“50”
在代码中可以
editText.setFilters( new InputFilter[]{ new InputFilter.LengthFilter( 100 )});
限制其只能输入数字的话可以
android:numeric="integer"
转载于:https://www.cnblogs.com/liangge0218/archive/2013/03/26/3292382.html