要在软键盘中显示表情按钮,我在EditText中使用以下命令:
android:inputType="textShortMessage"它使用我的设备的表情图标(可能特定于我的运营商/手机型号)。
我想用我自己的一套绘图工具来代替。有没有一种方法可以做到这一点,而不必创建一个全新的软键盘?
发布于 2014-12-07 02:41:38
不,没有任何单行的解决方案,也许在棒棒糖有一个,因为它是与表情符号一起提供的。
选项:
发布于 2015-01-13 03:09:01
我能够通过使用来自here的EmojiHandler解决这个问题:
要从文本消息内容中获取表情符号的unicode:
String s = EmojiHandler.decodeJava(content);
// use decoded string to display emoji in TextView, Button, etc
textButton.setText(s);要从软键盘对表情进行编码并将其放入字符串中:
String encodedEmoji = EmojiHandler.encodeJava(msgText);https://stackoverflow.com/questions/27334975
复制相似问题