我打算在webview中顯示來自SD卡的圖像,以便利用他內置的webview的縮放功能。但是,我在使用大於屏幕尺寸的圖像(例如1800x1200)來顯示適合屏幕的問題(如ImageView中)時遇到了問題。我想要首先完整顯示圖像,並向用戶提供縮放控制。 我已經嘗試使用WRAP_CONTENT爲webview的寬度和高度,但那不起作用。 任何想法? 以下是我使用的代碼片段:在webview中適合圖像
String path = getRealPathFromURI(mUriList.get(0)); // this gets the file path
webView = (WebView) findViewById(R.id.WebView01);
WebSettings settings= webView.getSettings();
settings.setBuiltInZoomControls(true);
settings.setSupportZoom(true);
webView.loadUrl("file://" + path);
的可能的複製[燦Android的WebView中自動調整圖像巨大?](http://stackoverflow.com/questions/3099344/can-androids-webview-automatically-resize-huge-images) – 2015-12-08 17:25:22