Android-如何将自定义CSS插入WebView中的外部网页 [英] Android - How to inject custom css into external webpage in webview
本文介绍了Android-如何将自定义CSS插入WebView中的外部网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想像下面那样将自定义CSS应用于WebView的外部网页
I want to apply Custom CSS into external webpage in WebView just like follow
webView.loadUrl("<style>body {font-size:15px;}</style>");
webView.loadUrl("http://www.stackoverflow.com");
推荐答案
String html = ... // load manually
// insert the style to <head>
webview.loadData(html, "text/html", null);
这篇关于Android-如何将自定义CSS插入WebView中的外部网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文