android - 无法使用退格键删除 editText 中的内容?

标签 android android-edittext android-textwatcher

有一个应用了 textWatcher 的 editText。正如您在下面的 Gif 中看到的,我无法从 EditText 的末尾删除数字,但首先。当语言环境是英语时一切正常,但不是阿拉伯语。

enter image description here

   <EditText
        android:id="@+id/destination"
        android:inputType="number"
        android:maxLength="19"
        android:digits="0123456789-"
        android:hint="@string/to"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textSize="16sp"
        android:imeOptions="actionDone"
 />

最佳答案

阿拉伯语不是从右向左读的吗?所以左边实际上是结束。

好的,尝试添加 android:inputType="number"

关于android - 无法使用退格键删除 editText 中的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47393683/

相关文章:

android - 自定义微调器适配器 simple_spinner_dropdown_item 显示不正确

android - 在android中结合多字符串和文本

android - 在android中的edittext中使用spannable

android - 带有Gradle的Android Studio拼写检查器

java - 我们如何修复这个错误? java.lang.IllegalStateException

android - 如何在 Android 中将自定义键盘设置为设备的默认键盘。

android - 如何在 TextWatcher 中验证 URL 同时匹配空字符串

android - TextWatcher 的 onTextChanged、beforeTextChanged 和 afterTextChanged 的​​区别

java - 如何使用 TextWatcher 更新相同的 EditText?

Android Livedata Observer 协程 Kotlin