Phonegap Android键盘覆盖了输入元素,滚动已禁用 [英] Phonegap Android keyboard covers input elements scrolling is disabled

查看:61
本文介绍了Phonegap Android键盘覆盖了输入元素,滚动已禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了许多不同的解决方案,但我没有想要的东西.我想要的是让键盘显示在内容的顶部(保持内容的大小相同),同时能够滚动到键盘覆盖的输入元素.

我尝试过的每个解决方案都会给我一个或另一个,但不能同时给我.

我尝试过的解决方案:

  • 解决方案此处.在我的AndroidManifest.xml的主要活动中添加android:windowSoftInputMode ="adjustPan"和android:configChanges ="orientation | keyboardHidden".
  • 上述解决方案使用"adjustResize"而不是"adjustPan".
  • 解决方案此处.添加到我的confix.xml.

使用adjustPan可以使元素保持相同的大小,但是会禁用滚动.使用adjustResize调整整个页面的大小,使所有内容缩影.保留默认设置,仅调整包含输入元素的包装的大小,但启用滚动.

我设法找到了完全相同的问题(未回答)感谢您的帮助.

对于config.xml中的大多数情况,请将全屏偏好设置更改为false.可以解决问题.

<preference name="fullscreen" value="false" />

I've tried many different solutions and nothing is quite what I want. What I want is for the keyboard to show on top of the content (keeping the content the same size) while being able to scroll to input elements that are covered by the keyboard.

Every solution I've tried will either give me one or the other, but not both.

Solutions I've tried:

  • Solution here. Adding android:windowSoftInputMode="adjustPan" and android:configChanges="orientation|keyboardHidden" to the main activity in my AndroidManifest.xml.
  • The above solution using "adjustResize" instead of "adjustPan".
  • Solution here. Adding to my confix.xml.

Using adjustPan keeps my elements the same size, but disables scrolling. Using adjustResize resizes the entire page, making everything miniature. Keeping default settings, only the wrapper containing the input elements is resized, but scrolling is enabled.

I managed to find the exact same problem (unanswered) here. They were able to "fix" it by resizing their app to 150% and scroll to the covered input element, but like they said it's not ideal.

Any help is appreciated.

解决方案

For most of the cases in config.xml change the full screen preference to false. that'll do the trick.

<preference name="fullscreen" value="false" />

这篇关于Phonegap Android键盘覆盖了输入元素,滚动已禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆