覆盖默认的 Android 键盘
在我的应用程序中,当用户使用虚拟键盘编辑某个 MultiAutoCompleteTextView 时,我想向他展示默认的 android 键盘,但更改其上的两个按钮 - 不是它们的位置,而是它们上的绘图(语音输入和笑脸按钮)及其功能。 有没有一种方法可以在不创建新的 InputMethod 或新的键盘类的情况下做到这一点?
In my app, when the user is editting a certain MultiAutoCompleteTextView with a virtual keyboard, I want to present him the default android keyboard, but change two of the buttons on it - not their locations, but the drawings on them (the voice input and the smiley buttons), and their functionality.
is there a way of doing so without creating a new InputMethod or a new keyboard class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,您当然可以创建一个自定义软键盘,但我认为您应该接受您的场景中所拥有的内容。为如此小的需求创建新的键盘输入确实会增加您的项目成本。
查看 SoftKeyboard 的 SDK 示例,了解有关创建该软件的更多信息。您始终可以将操作键定义为笑脸按钮。
这是直接来自 android 开源项目的代码示例:
请注意
android:inputType="textShortMessage"
它正在执行此操作并创建一个笑脸按钮作为操作按钮。Well you can certainly create a custom soft keyboard, But I think you should live with what you have in you scenario. To create a new keyboard input for such a small requirement will really be an overhead to your project cost.
Check out SDK Sample for SoftKeyboard for more information on creating that. You can always define you action key to be smiley button.
Heres a code sample directly from android open source project:
note the
android:inputType="textShortMessage"
which is doing the trick and creating a smiley button as the action button.