Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android css background-image not found

Tags:

android

css

I'm trying to use a image texture for my webpage body background. My webpage is shown in an Android webview.

Here is my CSS :

body
{
    font-family: helvetica;
    font-size: 12px;
    color: #555555;
    padding: 10px;
    /*background-color:#000000;*/
    background-image:url(bg_header_sample.png);
}

the css is inside an HTML file named Template.html. both Template.html and bg_header_sample.png are in the same assets folder : assets/global.

If I un-comment the background-color:#000000; line my body turn to black as wanted.

but with the current CSS my body stay transparent ...

like image 785
Thomas Besnehard Avatar asked Nov 20 '25 22:11

Thomas Besnehard


1 Answers

The solution was to do it programmatically :

webView.setBackgroundResource(R.drawable.backgroundImage);

As explain in this question : Set a background image for a webview in Android

like image 117
Thomas Besnehard Avatar answered Nov 22 '25 12:11

Thomas Besnehard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!