Cordova 4.0 Linear-Gradient颜色CSS3无法在Android设备上运行

时间:2015-11-02 19:09:03

标签: android css3 cordova

我正在构建一个Cordova应用程序,我正在使用带有div的线性渐变,它已在所有浏览器中显示但是当我构建应用程序并使用我的Android设备打开它时,我没有显示渐变效果。 这是我试过的代码:

background: -moz-linear-gradient(top, #f1f0f0 0%, #ffffff 100%)!important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f0f0), color-stop(100%,#ffffff))!important;
background: -webkit-linear-gradient(top, #f1f0f0 0%,#ffffff 100%)!important;
background: -o-linear-gradient(top, #f1f0f0 0%,#ffffff 100%)!important;
background: -ms-linear-gradient(top, #f1f0f0 0%,#ffffff 100%)!important;
background: linear-gradient(to bottom, #f1f0f0 0%,#ffffff 100%)!important;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f0f0', endColorstr='#ffffff',GradientType=0 )!important;

我也试过这段代码:

background-image: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#f1f0f0),color-stop(50%,#FCFCFC), color-stop(100%,#ffffff));
background-image: -webkit-gradient(linear,  top, bottom, from( #ffffff), to( #f1f0f0)) !important; 
background-image: -webkit-linear-gradient(#f1f0f0, #FCFCFC, #ffffff) !important; 
background-image:    -moz-linear-gradient(#f1f0f0, #FCFCFC, #ffffff) !important; 
background-image:     -ms-linear-gradient(#f1f0f0, #FCFCFC, #ffffff) !important; 
background-image:      -o-linear-gradient(#f1f0f0, #FCFCFC, #ffffff) !important; 
background-image:         linear-gradient(#f1f0f0, #FCFCFC, #ffffff) !important;

但它没有任何改变.. 任何想法或解决方案?

1 个答案:

答案 0 :(得分:1)

您可以使用Crosswalk代替默认情况下Cordova使用的默认Webview来解决此问题。当您安装Crosswalk时,这将取代Android附带的有缺陷的webview,并使用Crosswalk浏览器。

https://crosswalk-project.org/documentation/cordova.html