Android : EditText with custom keyboard

末鹿安然 提交于 2019-12-06 05:45:45

问题


I created my own custom keyboard following the the example in the sdk.

Now I would like to use this custom keyboard by default on my EditText in my app (actualy I have to long press the edittext and then choose my custom keyboard).

How can I do that ? (seems to be related to the inputType property but I can't find out how to set it)

Thanks !


回答1:


How can I do that?

Have your users set your keyboard to be their default. Applications do not have control over that.




回答2:


If by saying "I created my own custom keyboard" you mean you wrote your own IME, this is probably not what you want. An IME is a separate component that is designed to interact with any other application on the device for text input.

If you just want a custom keyboard in your own app, you should implement that inside your app as part of its UI.




回答3:


Try using a PopupWindow containing the layout of your custom keyboard, position the popup Window at bottom of the screen and handle clicks of the custom keyboard buttons yourself. Do disable the virtual keyboard before you do that.

For example of popup window, you can check: http://al1us.net/?p=131

use GRAVITY.BOTTOM in showAtLocation() function



来源:https://stackoverflow.com/questions/2797958/android-edittext-with-custom-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!