0

我对应用程序开发非常陌生,我已经从现有来源开发了一个软键盘,我已经提到过,SDK softkeyboard sample但在添加表情符号方面没有任何帮助。

我想将自己的表情符号添加到软键盘中,我该如何实现呢?根据我的研究,我只发现了如何创建实际的软键盘本身,但我没有发现如何创建自定义软键盘(添加您自己的表情符号)。任何有关如何将自定义表情符号添加到软键盘的建议、博文或参考资料将不胜感激。谢谢!

4

1 回答 1

1

Add a keyboard layout in XML, similar to qwerty.xml, symbols.xml, etc., replacing the keys with keys that use your emoticon icons (android:keyIcon="@drawable/smiley_icon", for example) and that output that text for the emoticon (android:keyOutputText=":-)", for example). Then add a keyboard, named something like mEmoticonKeyboard, to your SoftKeyboard class and instantiate it in the same way that mQwertyKeyboad, mSymbolsKeyboard, etc. are created.

To show this keyboard, add it to the keyboard rotation cycle on handleShift().

于 2012-04-12T03:23:25.000 回答