Android code for enable zoom in webview
Android code for disable zoom in webview
zoom for webview in android
ourSite is variable assigned to webView1
add following code for enable zoom
WebView ourSite = (WebView) findViewById(R.id.webView1);
WebSettings zoomenable = ourSite.getSettings();
zoomenable.setBuiltInZoomControls(true);
WebSettings wideviewenable = ourSite.getSettings();
wideviewenable.setUseWideViewPort(true);
add following code for diable zoom
WebView ourSite = (WebView) findViewById(R.id.webView1);
WebSettings zoomenable = ourSite.getSettings();
zoomenable.setBuiltInZoomControls(false);
WebSettings wideviewenable = ourSite.getSettings();
wideviewenable.setUseWideViewPort(false);
Import header file:-
// for webview
import android.webkit.WebView;
// for webview setting
import android.webkit.WebSettings;
Android code for disable zoom in webview
zoom for webview in android
ourSite is variable assigned to webView1
add following code for enable zoom
WebView ourSite = (WebView) findViewById(R.id.webView1);
WebSettings zoomenable = ourSite.getSettings();
zoomenable.setBuiltInZoomControls(true);
WebSettings wideviewenable = ourSite.getSettings();
wideviewenable.setUseWideViewPort(true);
add following code for diable zoom
WebView ourSite = (WebView) findViewById(R.id.webView1);
WebSettings zoomenable = ourSite.getSettings();
zoomenable.setBuiltInZoomControls(false);
WebSettings wideviewenable = ourSite.getSettings();
wideviewenable.setUseWideViewPort(false);
Import header file:-
// for webview
import android.webkit.WebView;
// for webview setting
import android.webkit.WebSettings;
*disable ;-)
ReplyDelete