Android 想要带“编辑文本”的键盘;输入Key";而且没有自动预测
我已经尝试了所有的组合,但仍然没有达到我想要的,所以请帮助我 我想要什么 我需要键盘不带Android 想要带“编辑文本”的键盘;输入Key";而且没有自动预测,android,android-edittext,android-softkeyboard,Android,Android Edittext,Android Softkeyboard,我已经尝试了所有的组合,但仍然没有达到我想要的,所以请帮助我 我想要什么 我需要键盘不带自动预测和带有回车键的多用途键盘 单次按下:应转到下一行 长按:应显示表情键盘 及 这是代码 <EditText android:id="@+id/editTextWord" android:gravity="top|start" android:paddingStart="8dp" android:scrollbarStyle="insi
自动预测
和带有回车键
的多用途键盘
<EditText
android:id="@+id/editTextWord"
android:gravity="top|start"
android:paddingStart="8dp"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical"
android:overScrollMode="always"
android:background="@color/background_walk_through_six"
android:paddingEnd="8dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_above="@+id/txtCharacters"
android:backgroundTint="@android:color/transparent"
android:inputType="textMultiLine"
android:layout_width="match_parent"
android:layout_height="match_parent" />
我想你现在明白我需要什么了 您可以这样通过编程实现:
editText.setImeOptions(EditorInfo.IME_ACTION_UNSPECIFIED);
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
由于inputType
需要多个值,您可以将其添加到xml中,如下所述:
editText.setImeOptions(EditorInfo.IME_ACTION_UNSPECIFIED);
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_MULTI_LINE);