Edittext的getMaxLenght在Android中

时间:2014-12-29 19:36:08

标签: android android-edittext

如何在Android中获取Edittext的MaxLength?

已经设定了:

android:maxLength="6

OR

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

1 个答案:

答案 0 :(得分:1)

函数getMax在API级别21中添加,旧版本使用此How to Get EditText maxLength setting in code