Cordova灰色背景颜色

4
我是Cordova/PhoneGap开发的新手。 在部署到iPhone时,我注意到应用程序后面有一个浅灰色背景颜色。当设备从纵向旋转到横向(反之亦然)时,这是明显的。您还可以在使用默认启动应用程序上下滚动时看到它。涟漪模拟器没有这种效果。
您知道这种颜色来自何处以及如何覆盖它吗?我尝试使用修改config.xml。我肯定可以设置body的css背景颜色,但这不会更改灰色背景。
下面是从iPhone中获取的一些屏幕截图,您可以在其中查看默认示例应用程序上旋转或向上滚动时的灰色背景。 ios screenshot 1 ios screenshot 2
2个回答

0

在index.css中将所有背景属性注释掉对我有用:

body {
    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */

    /*background-color:#E4E4E4;
    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
    background-image:-webkit-gradient(
        linear,
        left top,
        left bottom,
        color-stop(0, #A7A7A7),
        color-stop(0.51, #E4E4E4)
    );
    background-attachment:fixed;*/

    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
    font-size:12px;
    height:100%;
    margin:0px;
    padding:0px;
    text-transform:uppercase;
    width:100%;
}

0

你需要在位于www/css/index.cssindex.css文件中更改body标签的背景颜色。

希望能对你有所帮助。


1
嗨,Naresh。如果我在index.css中更改了页面的背景颜色,它确实会更改页面的背景颜色。但是,当我旋转或向上滚动时,它仍然具有奇怪的灰色背景。 - Jamie Richardson

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接