简体   繁体   English

如何在Android中实现屏幕键盘?

[英]How to implement an onScreen Keyboard in Android?

The default keyboard of android covers the EditText in my app UI. android的默认键盘覆盖了我的应用程序UI中的EditText。 So i need to implement my on keyboard. 所以我需要在键盘上实现我的功能。 Just like a keyboard in Regular Calculator app. 就像常规计算器应用程序中的键盘一样。 Which is the best way to implement it? 哪种是最佳实施方式? Is there any library available? 有图书馆吗?

Custom keyboard 自定义键盘

This link has everything required to create custom keyboard 此链接包含创建自定义键盘所需的一切

In order to do not hide your edittext under the keyboard, you need to add the following line inside your Manifest file, under your activity section. 为了不将编辑文本隐藏在键盘下,您需要在清单文件中的活动部分下添加以下行。

 <activity 
      android:windowSoftInputMode="adjustPan"
      ...
      ...

Moreover, depending on your needs you can have the numeric keypad or the common keyboard shown. 此外,根据您的需要,您可以显示数字键盘或通用键盘。 But this is more than what you asked. 但是,这超出了您的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM