1

My project ver is 2.2. I am using Zoom function in Webview.

wv.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);
wv.getSettings().setBuiltInZoomControls(true);

When using the zoom feature webview Zoomcontrol appears, I want it to disappear.

API Level 11 have method:getSettings().setDisplayZoomControls (boolean enabled)

What should I do in 2.2.

Anybody know who? I need Help...

MR.Smile
  • 11
  • 1
  • using the zoom feature webview Zoomcontrol appears and you want it to disappear....really annoying. Its like you want it but don't like it. – Paresh Mayani Nov 10 '11 at 06:13

2 Answers2

1

For zoomControl dismiss in version below API 11, The only solutions in my case works is, (This is something like a ugly way but I think this is the only solution)

Make a class extending WebView and overriding OnTouchEvent. In OnTouchEvent for ACTION_DOWN,
I check how many pointers there are using MotionEvent.getPointerCount(). If there is more than
one pointer, I call setSupportZoom(true), otherwise I call setSupportZoom(false). I then call
the super.OnTouchEvent().

For more info look at this question enable/disable zoom in Android WebView.

Community
  • 1
  • 1
user370305
  • 108,599
  • 23
  • 164
  • 151
  • First, thanks for an answer. The point of my question when I use the zoom feature does not make zoomControl is appearing. – MR.Smile Nov 10 '11 at 06:32
0

implements OnTouchListener to your activity registered webView touch listener in activity to webview. and in touch listener check the touch where it clicked and you can return false or do something.

@Override
    public boolean onTouch(View v, MotionEvent event) {
        if (v.getId() == R.id.WebView && event.getAction() == MotionEvent.ACTION_DOWN){
        }

    }
ud_an
  • 4,939
  • 4
  • 27
  • 43