当键盘显示 phonegap 时页面内容不滚动 [英] page content don't scroll when keyboard shows phonegap

查看:35
本文介绍了当键盘显示 phonegap 时页面内容不滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我在尝试输入字段时遇到问题,键盘隐藏了其他字段,这些字段是屏幕截图

我们如何解决我希望页面可滚动的问题,有关信息,我正在使用 phonegap 构建这肯定需要更改 config.xml 我真的不知道该怎么做.

解决方案

我也遇到了这个问题 - 潜在的问题似乎是您无法使用 Phonegap Build 编辑 androidManifest 文件 - 您所能做的就是编辑配置.xml 文件,它实际上只允许您更改有限的设置子集.我想要的(以及很多其他人已经尖叫了很长时间)是能够更改 windowSoftInputMode.

然而,我确实找到了解决我的问题的方法 - 键盘出现在屏幕底部的字段上,我认为这与您遇到的问题相同.对我来说 - 我使用的是最新的 phonegap 2.7.0(但能够通过在 config.xml 文件中指定 phonegap 2.5.0 来重现相同的行为和解决方案)

我找到的解决方案是在 config.xml 中更改此设置

这确实意味着你会在屏幕顶部看到状态栏"..这对我来说没什么大不了的(事实上我认为最好把它放在那里......至少对于我的应用程序) - 使用该设置设置为false"而不是true" - 页面现在向上滚动以在键盘打开时显示您正在编辑的字段.(更准确地说,我相信视口会发生变化而不是向上滚动)

希望能帮助并解决您的问题.. 花了我数小时的搜索和摆弄才让它工作(如果我没有发现我将不得不放弃 phonegap build)

快乐!迪伦

In my application the registration I have an issue when I try to type in field the keyboard hides the other fields those are the screenshots

how can we fix that I want the page to be scrollable, for info I'm using the phonegap build this needs for sure changes into the config.xml I don't know really how to do it.

解决方案

I had this problem as well - the underlying problem it seems is you can't edit the androidManifest file with Phonegap Build - all you can do is edit the config.xml file which really only allows you to change a limited subset of settings. What I would like (and a lot of others have been screaming for a long time fo) is to be able to change the windowSoftInputMode.

I did however find a solution to my problem - which was the keyboard appearing over fields at the bottom of the screen which I think is the same problem you're having. For me - I'm using the latest phonegap 2.7.0 (but was able to reproduce the same behaviour and solution by specifying phonegap 2.5.0 in the config.xml file)

The solution I found was to change this setting in config.xml

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

This does mean you get the 'status bar' at the top of the screen.. which is no biggie for me (in fact I think it's better to have it there.. at least for my app) - with that setting set to "false" instead of "true" - the page now scrolls up to reveal the field you're editing when the keyboard opens. (to be more precise, I believe the viewport changes rather than scroll up)

Hope that helps and solves your problem.. took me hours of searching and fiddles to get it to work (if I didn't find that I would have had to abandon phonegap build)

joy! Dylan

这篇关于当键盘显示 phonegap 时页面内容不滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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