How to avoid zoomcontrols from webview


#1

can anybody mention how to avoid the zoom option to a default (mobileview) size while using WebView


#2

You mean on Android, right? Here’s an Angular example, but it’s almost identical for regular NativeScript:

HTML file:

  <WebView backgroundColor="#fff" [src]="text" (loaded)="webViewLoaded($event)"></WebView>

TypeScript file:

  webViewLoaded(args: EventData): any {
    const webView: WebView = <WebView>args.object;
    if (webView.android) {
      webView.android.getSettings().setDisplayZoomControls(false);
      webView.android.getSettings().setBuiltInZoomControls(false);
    }
  }

#3

thanks for your reply, but am using javascript. I used the same logic in JS but not working


#4

thank you i got it now,thank you very much