2016-11-18 4 views
-1

何とか私のCordovaプロジェクトで背景グラデーションをレンダリングできません。CordovaでCSSの背景グラデーションを使用しない

background: #f5a953; 
background: -moz-linear-gradient(top, #f5a953 0%, #fde1b2 49%, #f5a953 100%); 
background: -webkit-linear-gradient(top, #f5a953 0%,#fde1b2 49%,#f5a953 100%); 
background: linear-gradient(to bottom, #f5a953 0%,#fde1b2 49%,#f5a953 100%); 

携帯端末で空白の白い背景を取得します。

  • backgroundからbackground-imageへの影響はありません。
  • backgroundからbackground-colorに変更すると、少なくとも背景が着色されます。しかし、まだグラデーションはありません。

Cordovaプロジェクトの背景にグラデーションを表示させるにはどうすればよいですか?

EDIT:

私は今cordova create testと簡単なテストプロジェクトを作成し、次へのCSSの背景を変更しました:

background-color: #fde1b2; 
background-image: -moz-radial-gradient(center, ellipse cover, #fde1b2 0%, #f5a953 100%); 
background-image: -webkit-radial-gradient(center, ellipse cover, #fde1b2 0%,#f5a953 100%); 
background-image: radial-gradient(ellipse at center, #fde1b2 0%,#f5a953 100%); 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fde1b2', endColorstr='#f5a953',GradientType=1); 

chrome_desktop_view(正しい) chrome_desktop_view (correct)

chrome_mobile_view (正しい) chrome_mobile_view (correct)

galaxy_s6のAndroid 6.0.1(間違っている!) galaxy_s6 (wrong!)

+0

の可能性のある重複(http://stackoverflow.com/questions/ 10536876/css3-linear-gradient-not-working-on-android) –

+0

http://stackoverflow.com/questions/9264640/css-android-web-app-color-gradient-issue ---- http:// stackoverflow.com/questions/10536876/css3-linear-gradient-no t-working-on-androidこれらの答えをお読みください。 –

+0

私はこの質問をする前に両方を見つけましたが、その解決策は私の問題には影響しません。以前はウェブを検索していなかったとは思わない。 – Julisch

答えて

0

私の代わりに体全体のコンテナのdivに背景グラデーションを割り当てることで問題を解決しました。

Chromeには、<body>タグに割り当てられている背景勾配が表示されないようです。

私は、クロムが奇妙な背景勾配を示した単純なコンテナdivを作成しました。

HTML:

<body> 
    <div id="container"> 
     ... 
    </div> 
</body> 

CSS:[。CSS3の線形勾配は、Android上で動作していない]

body { 
    (nothing about the background) 
} 

div#container { 
    background-color: #fde1b2; 
    background-image: -moz-radial-gradient(center, ellipse cover, #fde1b2 0%, #f5a953 100%); 
    background-image: -webkit-radial-gradient(center, ellipse cover, #fde1b2 0%,#f5a953 100%); 
    background-image: radial-gradient(ellipse at center, #fde1b2 0%,#f5a953 100%); 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fde1b2', endColorstr='#f5a953',GradientType=1); 
} 
関連する問題