【发布时间】:2012-05-19 14:36:36
【问题描述】:
我正在尝试使用 WebView 来显示具有内置多点触控的大图像并尝试避免内存崩溃。
我这样设置 webView:
setInitialScale(20);
WebSettings settings = getSettings();
settings.setJavaScriptEnabled(true);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
然后加载以下代码:
<head>
<meta
name="viewport"
content="width=device-width, user-scalable=yes"
/>
</head>
<body
style="margin: 0; padding: 0">
<img
alt="image"
src="THE_SRC_GOES_HERE"
id="theImage"
>
</body>
问题在于,如果它加载一个中等大小的图像(例如 1600x1200),它会很好地工作并且图像适合屏幕宽度。
但如果在我的示例中图像更大 7300x5200,它看起来就像放大并且禁用了缩小。
如果你想测试图片的url是:
注意:我不是该图像的所有者,我只是将其用于测试
【问题讨论】: