iphone - 当 iphone/ipad 中出现软键盘时背景图像调整大小/消失(使用phonegap)

标签 iphone ipad cordova

我在运行iPhone的phonegap代码时遇到一个问题,即当iPhone/ipad设备的软键盘(默认)出现时,背景图像消失或调整大小,您可以在下图中看到。如果您有解决此问题的任何想法,请提出建议。

enter image description here

enter image description here

这里有一些代码:

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="description" content="">
 <meta name="viewport" content="width=device-width">
 <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="user-scalable=0, initial-scale=1, minimum-     scale=1, width=device-width, height=device-height" />

正文:

<body>
 <div id="login-back" >
    <section class="log-email">
    <a class="back-icon" href="index.html"><img  src="img/back-icon.png" alt=""></a>
    <h3>Login</h3>
    <div class="log-email-container">
     <ul class="contact_form">

                        <li class="clearfix">
                            <input type="text" name="" id="email" placeholder="E-mailadres">
                        </li>
                        <li class="clearfix">
                            <input type="password" name="" id="pwd" placeholder="wachtwoord">
                        </li>                            
                        <li class="clearfix">
                            <input type="submit" value="Inloggen" id="llogin"  style="font-size: 14px; " onclick="login();"  name="">
                        </li>
                        <li>
                           <a href="reset-pass.html" id="linkfp" style="font-size: 16px;"><u>Wachtwoord vergeten?</u></a>
                        </li>
                        <li id="test">
                        </li>
                    </ul>
    </div>
    </section>
 </div>

  </div>
</body>

CSS:

 #login-back
 {
    background:url(../img/bg.jpg)no-repeat fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: 100% 100%;
    height: 100%;
  }

最佳答案

有点晚了,但我希望有人能得到这个有用的答案。 试试这个 css 指令:

background-attachment:fixed;

关于iphone - 当 iphone/ipad 中出现软键盘时背景图像调整大小/消失(使用phonegap),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23010274/

相关文章:

ios - 长按按钮显示 UIView

iphone - 运动开始: Not Working

iphone - 如何在 iPhone SDK 中集成 Google Image Search API?

cordova - 在手机间隙使用本地存储

ios - 谓词的核心数据提取请求错误

iphone - 在 UIPageViewController 内容 View 中给出页码

iPhone - 在 UITableView 上拖动会停止在后台渲染 OpenGL

iphone - Javascript和 objective-c

javascript - 如何在 Phonegap 中创建嵌套目录

javascript - 使用 Phonegap,我如何检查剩余的可用磁盘空间?