空闲时间为了避免自己去浪费时间就来这里写一些日常遇到的小问题,一来自己以后可以回来看看,二来可能还能帮到一些朋友.
private void Dialog() {
View view = LayoutInflater.from(context).inflate(R.layout.dialog, null);
WebView wb = (WebView) view.findViewById(R.id.webview_picture);
WebSettings wbs = wb.getSettings();
//设置自适应屏幕,两者合用
wbs.setUseWideViewPort(true);//将图片调整到适合webview的大小
wbs.setLoadWithOverviewMode(true); // 缩放至屏幕的大小
//缩放操作
wbs.setSupportZoom(true);//支持缩放,默认为true。是下面那个的前提。
wbs.setBuiltInZoomControls(true);//设置内置的缩放控件。若为false,则该WebView不可缩放
wbs.setDisplayZoomControls(false); //隐藏原生的缩放控件
//设置背景透明
wb.setBackgroundColor(0);