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

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

问题描述

在我的应用程序中,我注册时有一个问题,当我尝试键入字段时,键盘隐藏了其他字段,这些是截图





我们如何解决我希望页面可以滚动的问题,我正在使用phonegap build
this需要确定更改到config.xml我不知道该怎么做。

解决方案

我有这个问题,因为好 - 看起来底层的问题是你不能用Phonegap Build编辑androidManifest文件 - 你所能做的只是编辑config.xml文件,它实际上只允许你改变一个有限的设置子集。
我想要的是什么(以及很多其他人一直在尖叫很长时间)是能够更改windowSoftInputMode。



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

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

 < preference name =全屏value =false/> 

这意味着您在屏幕顶部显示'状态栏'。 biggie对我来说(事实上,我认为最好是在那里......至少对于我的应用程序来说) - 将该设置设置为false而不是true - 现在滚动页面以显示您正在编辑的字段当键盘打开时。 (更确切地说,我相信视口会改变而不是向上滚动)



希望帮助和解决您的问题..花了我几个小时的搜索和小提琴来获得它(如果我没有发现我将不得不放弃phonegap构建)

欢乐!
Dylan


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天全站免登陆