简体   繁体   English

科尔多瓦灰色背景颜色

[英]Cordova gray background color

I'm new to Cordova/PhoneGap development. 我是Cordova / PhoneGap开发的新手。 When deploying to an iPhone, I noticed this light gray background color behind the app. 在部署到iPhone时,我注意到应用程序背后的浅灰色背景颜色。 It's noticeable when the device rotates from portrait to landscape (and vice versa). 当设备从纵向旋转到横向时(反之亦然),这是显而易见的。 You can also see it when scrolling up or down with the default start app. 使用默认启动应用程序向上或向下滚动时,您也可以看到它。 The ripple emulator doesn't have this effect. 纹波仿真器没有这种效果。

Any idea where this color comes from and how to override it? 知道这种颜色来自哪里以及如何覆盖它? I tried modifying config.xml with . 我尝试用config修改config.xml。 I can certainly set the body's css background color, but this does not change the gray background. 我当然可以设置身体的css背景颜色,但这不会改变灰色背景。

Below are some screenshots from the iPhone, where you can see the gray background when rotating or scrolling up with the default sample app. 以下是iPhone的一些屏幕截图,您可以在使用默认示例应用程序旋转或向上滚动时看到灰色背景。

ios screenshot 1 ios screenshot 2 ios截图1 ios截图2

You have to change the background color of body tag in index.css file which is located at www/css/index.css 您必须在index.css文件中更改body标签的背景颜色, 文件位于www / css / index.css

Hope it helps you 希望它能帮到你

Commenting out all the background properties in index.css solved it for me: 注释掉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%;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM