Webview android does not load css image

Asked

Viewed 543 times

0

I am loading an html page with a css in a webview, all files are local and are in the same folder. It’s working normally on my Motorola Moto X 2 device and on my Galaxy Tab 10 tablet, but in Galaxy Tab 4 version 4.4.2 the image is not being rendered by css.

Command I use to load the page:

webView.loadUrl(Uri.fromFile(index).toString());

Where index is the index.html file of the folder;

CSS that loads the image:

.bt_play{background:url('ico_play.png') no-repeat right;   padding: 20px 75px 20px 5px!important; display:table; float: right;}
.bt_play p{font-size: 1.7em!important;}

I’ve used various techniques and codes to make the image appear on this specific tablet, but nothing works... Anyone have any idea?

1 answer

1

You can configure the best hardware performance with:

webview.getSettings().setRenderPriority(RenderPriority.HIGH);
webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);

Or on the manifest put:

android:hardwareAccelerated="true"
  • thanks, but it worked by putting android:hardwareAccelerated="true" in the manifest.

  • I edited the answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.