简体   繁体   English

Android 4.0+ EditText禁用自动更正

[英]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.

相关问题 如何在Android 4.0+设备上以编程方式禁用“窗口动画比例”? - How to disable “Window animation scale” programmatically on Android 4.0+ devices? 如何在4.0+上更改Edittext下划线的颜色? - How change color of the underline of Edittext on 4.0+? 在Android 4.0+上的PostgreSQL中使用Hibernate或替代品 - Using Hibernate or alternative with PostgreSQL on Android 4.0+ httpclient(phpmyadmin)在Android 4.0+上不起作用 - httpclient (phpmyadmin) not working on Android 4.0+ 禁用主页按钮可在当前屏幕停留4.0+ - Disable home button for staying in current screen for 4.0+ Android 4.0版中的外部SD卡路径读取文件 - External SD card path in android version 4.0+ to read files Android - MediaPlayer即使在Android 4.0+上准备流之前就准备好了 - Android - MediaPlayer's on Prepare Called even before the stream is prepared on Android 4.0+ 为什么在Android 4.0+上支持v7 actionbar进入屏幕底部 - Why support v7 actionbar goes to screen bottom on android 4.0+ 如何检查自动旋转屏幕设置是否在 Android 4.0+ 中打开/关闭 - How to check if auto-rotate screen setting is ON/OFF in Android 4.0+ 在 facebook sdk 4.0+ 上获得可标记的朋友 - get taggable friends on facebook sdk 4.0+
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM