[英]Android 4.0+ EditText disable autocorrection
Im looking for a way to disable autocorrection in EditText (and optionally to live autosuggestions). 我正在寻找一种方法来禁用 EditText中的自动更正(以及可选的实时自动建议)。 Current code:
当前代码:
<EditText
android:id="@+id/text_message_edit_text"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textCapSentences|textMultiLine|textNoSuggestions|textFilter"
android:textSize="20sp" />
I have tried this solution adding textVisiblePassword
attribute. 我试过这个解决方案添加了
textVisiblePassword
属性。 It helped me, but after this button for language switch become disabled. 它帮助了我,但是在此语言切换按钮被禁用之后。
Is there a 100% way? 有100%的方式吗? No. Every keyboard application interprets the inputTypes a little differently, and not all of them honor all input types.
不是。每个键盘应用程序都会以不同的方式解释inputTypes,而不是所有键盘应用程序都尊重所有输入类型。 So there is no universal way to insure no auto corrects.
所以没有通用的方法来确保没有自动纠正。 Visible password is the best way since almost all keyboards honor it for security reasons.
可见密码是最好的方法,因为几乎所有键盘都出于安全考虑而尊重它。 Filter and no suggestions are also common flags to do it, but you have those.
过滤,没有建议也是常见的标志,但你有这些。 You're doing everything you can I'm afraid- that keyboard just is ignoring you and showing it no matter what.
你正在做的每件事我都害怕 - 键盘只是在忽视你并无论如何都要表现出来。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.