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
Post a Comment