0

Webviewでズームコントロールを設定しました

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

しかし、正しく動作しません。

ズームアウトするために画面をタッチすると(マルチタッチで指を使用)、画面にタッチした状態で動作します。

しかし、画面を取り外すと、元のサイズに戻ります。

ズームコントロールは、ズームアウト操作が正しく機能していることを覚えているので、もう一度やり直します

・ズームコントロール「+」ボタン変更無効状態(MAXズームアウト状態)

しかし、ウェブページはまだ変更されていません。(ズームは使えませんでした)

これはバグだと思います..

ウェブページは、プログラムによって作成された html です。

このような

<meta http-equiv=’Content-Type’ content=’text/html; charset=utf-8′ />
<html>
<body>
<img src="my image url" width="100%"></img></br>
</body>
</html>

とてもシンプルなhtmlソースです。

これについて何か考えはありますか??

直せますか?

4

2 に答える 2

2

I had a very similar problem, and think you have to replace the relative width with an absolute one. The source of the problem is, that the webview recalculates the width after you zoomed and again scales the image to fit 100% of screen width. I resized the image to the size of the screen in pixels (directly generated into the html code). Then the zoom works without problems.

See: Set minimum zoom level of webview (Android)

于 2013-11-09T09:53:48.523 に答える
0

画像タグからwidth="100%"を削除するだけです。それは魔法のように働き始めます。

于 2013-02-02T08:17:54.057 に答える