我正在创建注册页面,但并添加到每个TextInputEditText的下一步按钮,它是完美的工作没有任何问题,
但是每当我在布局中添加android:digits="0123456789qwertzuiopasdfghjklyxcvbnm_ "时,它就不起作用了。
解决这个问题的可能原因是什么?
下面是我的代码片段。
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColorHint="#c0c0c0"
app:errorEnabled="true"
app:theme="@style/MyTextInputLayoutStyle">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/activity_register_edit_text_state"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/state_region"
android:imeOptions="actionNext"
android:digits="0123456789qwertzuiopasdfghjklyxcvbnm_ "
android:inputType="textPersonName"
android:padding="@dimen/edittext_padding"
android:textColor="@color/text_color_light"
android:theme="@style/MyTextInputLayoutStyle"
app:errorTextAppearance="@style/TextErrorAppearance"
app:xfont="@string/roboto_regular" />
</com.google.android.material.textfield.TextInputLayout>提前谢谢。
发布于 2019-07-19 19:44:01
当你在EditText orTextInputEditText中设置android:digits时,它只允许你在其中定义的数字或字符。在android软输入(键盘)中,有一个next按钮,它有一个在android: digits中没有定义的唯一代码。
请参阅此link以更好地了解
https://stackoverflow.com/questions/57111511
复制相似问题