1

Is there any way to solve this? i don't want wo show the zoom control buttons in my webview,but it still supporting the zoom controls with mutiTouch.

thanks for your attention.

heatork
  • 21
  • 2
  • possible duplicate of [enable/disable zoom in Android WebView](http://stackoverflow.com/questions/5125851/enable-disable-zoom-in-android-webview) – yanchenko May 04 '13 at 19:06

1 Answers1

-1

If you want have zoom in/out without zoom controls then use the below code(copied from here)

public class Main extends Activity {
  private WebView myWebView;
  private static final FrameLayout.LayoutParams ZOOM_PARAMS =
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
Gravity.BOTTOM);

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.webview);
    myWebView = (WebView)findViewById(R.id.webView);

    FrameLayout mContentView = (FrameLayout) getWindow().
    getDecorView().findViewById(android.R.id.content);
    final View zoom = myWebView.getZoomControls();
    mContentView.addView(zoom, ZOOM_PARAMS);
    zoom.setVisibility(View.GONE);

    myWebView.loadUrl("http://www.almondmendoza.com");
  }
}
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Shankar Agarwal
  • 34,573
  • 7
  • 66
  • 64