WebView加载HTML格式网页

xiaoxiao2021-02-28  75

WebSettings settings = myWebView.getSettings(); //不显示webview缩放按钮 settings.setDisplayZoomControls(false); settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); //优先使用缓存 settings.setJavaScriptEnabled(true); //启动js功能 (json) settings.setBuiltInZoomControls(true); //显示放大缩小按钮(不支持已经适配好移动端的页面) settings.setUseWideViewPort(true); //双击缩放(不支持已经适配好移动端的页面) settings.setTextSize(WebSettings.TextSize.NORMAL); //文字大小 settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);//图片大小 settings.setUseWideViewPort(false); settings.setLoadWithOverviewMode(true); myWebView.loadDataWithBaseURL(null,“这里填HTML格式的数据”, “text/html”, “utf-8”, null);

转载请注明原文地址: https://www.6miu.com/read-60601.html

最新回复(0)