Why my old tablet doesn't support some css lin

2019-07-28 06:49发布

问题:

I try to make a hybrid app (using PhoneGap) but my main problem is that so far i looks different on every platform. I the browser on PC and on the Android 5.0+ looks as I want to but on older versions of android appear some problems. I've tested it on a 2 different tablets. Both with Android 4.2.2.(Samsung and Lenovo). Both of them don't recognize font unit vw (vh neither). One on them doesn't recognize commend "border-radius" or at least irregularly: photo. Whereas the second one has some troubles with animations e.g. like this one:

.totheleft{
animation-name: nalewotrzy;
animation-duration: 1.5s;
}

@keyframes totheleft{
to {transform: translate(-100%, 0%);}
}

And now I don't know if maybe the old versions of Android don't support CSS3 or I implemented my css file incorrectly into html code:

<head>
<link rel="stylesheet" href="index.css"/>
</head>

I'm quite new in programming.

回答1:

Until Android 5.0 Lollipop the WebView in each device is part of the Operating System image. Unfortunately this means that unless the OS is updated that HTML5 features/bugs are frozen in time.

With Android 5.0 the WebView is now based on a Google Play updated component called Android System WebView.

See: https://developer.chrome.com/multidevice/webview/overview

Alternatively you could use the CrossWalk Project: https://crosswalk-project.org/ as your WebView for a more consistent experience on old Android versions (4.1 and higher) but at the cost of making your app bigger due to adding in its own WebView.

See: https://crosswalk-project.org/documentation/about/faq.html#Distributing-Crosswalk-Project-applications and 71mb added to app size for crosswalk