如何以编程方式隐藏/禁用 Android 软键盘上的表情符号 [英] How to programmatically hide/disable emoticons on Android soft keyboard

查看:27
本文介绍了如何以编程方式隐藏/禁用 Android 软键盘上的表情符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以隐藏特定的键盘按钮?我有一个 EditText,在某些设备上,它的键盘有笑脸,而在其他设备上则没有.我想在所有设备上隐藏它.

Is it possible to hide a specific keyboard button? I have an EditText and on some devices its keyboard has smiley faces while on other devices it is missing. I want to hide it on all devices.

以下是我的 EditText 的 XML:

Below is the XML for my EditText:

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"

这可能吗?

推荐答案

我在使用 ICS 中的股票消息应用程序禁用键盘上的笑脸键".

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

You need to remove the textLongMessage option from the inputType.

大多数键盘上仍然会有:-)"按钮,但不会有表情符号.

You will still have the ":-)" button on most keyboards, but not the emoji.

这篇关于如何以编程方式隐藏/禁用 Android 软键盘上的表情符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆