Enable zoom on WebViews on Android

Summary: Make the behavior on a WebView allow pinch to zoom.  This matches what iOS has by default.  We may want to at some point put this behind a property but right now just make it work on Android.

Reviewed By: andreicoman11

Differential Revision: D3503429

fbshipit-source-id: adb2bb2c3de099aca08700786be7a132557a5e2a
This commit is contained in:
Dave Miller 2016-06-30 07:33:56 -07:00 committed by Facebook Github Bot
parent bb0fda7d54
commit ca0c6dbe36
1 changed files with 2 additions and 0 deletions

View File

@ -248,6 +248,8 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
webView.setWebChromeClient(new WebChromeClient());
reactContext.addLifecycleEventListener(webView);
mWebViewConfig.configWebView(webView);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setDisplayZoomControls(false);
if (ReactBuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);