WebView的简单实用

/*web*/
implementation 'org.jsoup:jsoup:1.11.3'
Document parse = Jsoup.parse(result.getDetails());
Elements imgs = parse.getElementsByTag("img");
if (!imgs.isEmpty()) {
    for (Element e : imgs) {
        imgs.attr("width", "100%");
        imgs.attr("height", "auto");
    }
}
String content = parse.toString();
webView.loadDataWithBaseURL(null, content, "text/html", "utf-8", null);

猜你喜欢

转载自blog.csdn.net/wangshuo_/article/details/89059555