数据源 String webview_str:
<p>
<img src="http://img.tianxiahuo.cn/goods/20160114/uploads/images/f1372c4467d7ca287b65ab2fb61840ec.png"
title="TB2o6XZdFXXXXXgXpXXXXXXXXXX_!!2176996747.jpg" alt="TB2o6XZdFXXXXXgXpXXXXXXXXXX_!!2176996747.jpg"/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
private initView(){
//设置webview相关属性
// 设置默认缩放
webview.setInitialScale(50);
WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setUseWideViewPort(true);// 这个很关键
webSettings.setLoadWithOverviewMode(true);
}
/**
设置数据展示
*/
private void updateView(String webview_str) {
final StringBuffer temp = new StringBuffer();
temp.append("<meta name='viewport' content='width=320' />").append(webview_str);
webview.loadDataWithBaseURL(null, temp + "<br/>", "text/html", "UTF-8", null);
webview.getSettings().setDomStorageEnabled(true);
}
android开发交流qq群欢迎各位加入(qq : 516884181)