android - 如何以编程方式隐藏/禁用 Android 软键盘上的表情符号

标签 android android-edittext android-softkeyboard

是否可以隐藏特定的键盘按钮?我有一个 EditText 并且在某些设备上它的键盘有笑脸,而在其他设备上它却不见了。我想在所有设备上隐藏它。

下面是我的 EditText 的 XML:

android:id="@+id/text_editor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/send_side"
android:hint="Enter your text"
android:imeOptions="actionSend|flagNoEnterAction"
android:inputType="textLongMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:maxLength="1000"
android:maxLines="3"
android:nextFocusRight="@+id/send_button"
android:padding="12dp"
android:textSize="13sp"

这可能吗?

最佳答案

我在“Disabling smiley key on keyboards with the stock messaging app in ICS”中找到了一些东西。

您需要从 inputType 中删除 textLongMessage 选项。

大多数键盘上仍然有“:-)”按钮,但没有表情符号。

关于android - 如何以编程方式隐藏/禁用 Android 软键盘上的表情符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23560686/

相关文章:

android - 自定义EditText垂直对齐方式

android - 如何同时拥有 singleLine ="false"和 imeOptions ="actionNext"用于 EditText?

android - 防止 ProGuard 评估数学表达式并删除 Android 中未使用的指令

java - 在哪里上传图片,以便 Glide 的 URL 保持不变

Android Lollipop EditText : AutoComplete Not Working For Email Addresses

android - 显示键盘时 Activity 未调整大小

android - TextWatcher onTextChanged 不适用于软键盘自动完成/建议词

android - 如何设置TextView的textStyle如粗体、斜体

Android:如何将浮点值传递给 mysql 服务器?

java - 我是否必须覆盖 `onEditorAction` 或者 "action_done"是否具有默认行为?