是否可以隐藏特定的键盘按钮?我有一台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"
这个是可能的吗?
发布于 2014-05-09 19:34:48
我在"Disabling smiley key on keyboards with the stock messaging app in ICS“里找到了些东西。
您需要从inputType
中删除textLongMessage
选项。
在大多数键盘上,你仍然会有":-)“按钮,但不会有表情符号。
发布于 2016-09-14 20:59:10
(为了完整起见)
这个解决方案是为那些需要在他们的软键盘上没有笑脸的文本视图的人准备的。@Adrian的解决方案,使用电子邮件地址类型,是可行的,但它会在你的键盘上显示不必要的'@‘和'.com’按钮。我尝试了几种InputType的组合,最好的解决方案是:
mTextView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
原始键盘:
生成的键盘:
发布于 2015-01-19 22:18:10
这对我在Android 4.4.2上是有效的
android:inputType="textEmailAddress|textMultiLine"
https://stackoverflow.com/questions/23560686
复制相似问题