开发者

Zoom in/out issue in webview in Android

开发者 https://www.devze.com 2023-03-15 04:54 出处:网络
I am displaying the image in webview. By using this: final String mimeType = \"text/html\"; final String encoding = \"开发者_开发技巧utf-8\";

I am displaying the image in webview. By using this:

final String mimeType = "text/html";
        final String encoding = "开发者_开发技巧utf-8";
        String filePath = "file://"+file;
        final String html = "<img width=\"100%\" height=\"100%\" src=\""+filePath+"\" />";
        Log.v("HTML",html);
        webViewe.loadDataWithBaseURL("fake://not/needed", html, mimeType, encoding, "");

When double click on the WebView its zoom the image but when again i double click on it the blank white screen is display. How to resolve it?


Do you mean you need zoom controls:

 webview.getSettings().setBuiltInZoomControls(true);
0

精彩评论

暂无评论...
验证码 换一张
取 消