【设置缓存模式和自适应控件】
webview.getSettings()
.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); // 设置 缓存模式
webview.getSettings().setDomStorageEnabled(true);
webview.getSettings().setDatabaseEnabled(true);
String cacheDirPath = getFilesDir().getAbsolutePath()
+ APP_CACAHE_DIRNAME;
webview.getSettings().setDatabasePath(cacheDirPath);
webview.getSettings().setAppCachePath(cacheDirPath);
webview.getSettings().setAppCacheEnabled(true);
//支持javascript
webview.getSettings().setJavaScriptEnabled(true);
// 设置可以支持缩放
webview.getSettings().setSupportZoom(true);
// 设置出现缩放工具
webview.getSettings().setBuiltInZoomControls(true);
//扩大比例的缩放
webview.getSettings().setUseWideViewPort(true);
//自适应屏幕
webview.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
webview.getSettings().setLoadWithOverviewMode(true);
其他参考:http://www.cnblogs.com/zgz345/p/3768174.html