Android WebView - CSS not working -


using android 5.0.2...

the following not showing properly. unable see styling.

<!doctype html> <html>     <head>         <style>             .bodybg{                 background: linear-gradient(#88ddff, #55aaff);                 width:100%;                 height:100%;                 background-position: 0, 0;                 background-size: 100%, 100%;                 position: absolute;             }         </style>     </head>      <body>         <div class="bodybg">             ...         </div>     </body> </html> 

the webview loaded html that.

webview webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); inputstream inputstream = context.getresources().openrawresource(r.raw.html_page); byte[] bytes = new byte[inputstream.available()]; inputstream.read(bytes); final string html = new string(bytes); webview.loaddata(html, "text/html", null); webview.addjavascriptinterface(new jswebapp(), "app"); 

how fix it?


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -