Jam*_*mal 5 android android-widget android-softkeyboard android-edittext
在我的Android项目中,我限制Edittext只允许使用Alphanumeric字符.我使用下面的代码片段来实现这一点
<EditText
android:id="@+id/edt_text"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
android:ems="10"
android:imeOptions="actionNext"
android:maxLength="8"
android:padding="5dp"
android:singleLine="true" />
Run Code Online (Sandbox Code Playgroud)
但是当我使用这个代码时,如果我选中它中的Space Bar显示soft keypad是作为一个BackSpace按钮并删除中的字符EditText.有人请帮我解决这个问题.