[英]Android - How to disable the paste suggestion on top of the soft keyboard
要为 EditText 元素禁用屏幕键盘上的粘贴建议功能,您可以在 EditText 的 XML 定义中为“android:inputType”属性指定“textNoSuggestions”值。
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions" />
或者您可以在代码中以编程方式设置 inputType 属性:
EditText editText = findViewById(R.id.edit_text);
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.