设置EditText只能输入数字和字母
-
android:inputType="number"(弹出数字键盘)
-
android:inputType="textEmailAddress"(弹出字母键盘)
-
android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
清单文件中,在需要隐藏软键盘的activity中加入
android:windowSoftInputMode="adjustUnspecified|stateHidden"
android中去掉EditText的自动焦点获取
将EditText的父级控设置成:
-
android:focusable="true"
-
android:focusableInTouchMode="true"