Android 软键盘/虚拟键盘重力/显示在中心
我创建了虚拟键盘。它显示在屏幕底部。我想在 EditText 附近显示键盘,而不调整屏幕大小和大小。不是屏幕底部。
例如,我有产品列表,该列表包含 EditText。当用户单击该 EditText 时,虚拟键盘应显示 EditText 的左侧/右侧。可以这样做吗?
第二个问题是:我们如何实用地改变android键盘重力或布局宽度?可以改变吗?
I have created virtual keyboard. Its showning bottom of the screen.I want to display my keyboard near the EditText without adjust screen size & not bottom of the screen.
For example I have list of product , that list contain EditText.When User click on that EditText that virtual keyboard should display left/right of EditText. IS it possible to do this?
Second question is: How we can change android keyboard gravity or layout width pragmatically? is it possible to change it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
改变它是可能的,但并不容易。
您可以使用它:
作为包含键盘的视图。然后,您必须在 Activity 中创建一个要附加到它的
Keyboard
对象,您可以使用 xml 创建自己的对象(如下所示),或者有多种方法可以实例化LatinIME< /code> 或其他将
Keyboard
扩展为标准系统键盘的类。我可以写一篇关于如何有效使用自己的键盘的整篇文章,但希望这能为您提供足够的线索,以便您能够自己查找教程。
这个示例应该会给你很多帮助。
祝你好运!
It is possible to change it but not easily.
You can use this:
As a view which will contain your keyboard. You must then, in your Activity, create a
Keyboard
object to attach to it, you can either create your own using xml (as I have below) or there are several ways to instantiateLatinIME
or other classes which extendKeyboard
as a standard system keyboard.I could write a whole article on how to use your own keyboard effectively but hopefully this will give you enough of a clue to be able to look up tutorials on your own.
This example should give you alot of help though.
Good luck!