onZoomScaleChanged method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebViewClient.onScaleChanged', apiUrl: 'https://developer.android.com/reference/android/webkit/WebViewClient#onScaleChanged(android.webkit.WebView,%20float,%20float)'), IOSPlatform(apiName: 'UIScrollViewDelegate.scrollViewDidZoom', apiUrl: 'https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom'), WindowsPlatform(apiName: 'ICoreWebView2Controller.add_ZoomFactorChanged', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#add_zoomfactorchanged')])
void onZoomScaleChanged(
  1. double oldScale,
  2. double newScale
)

Event fired when the zoom scale of the WebView has changed.

oldScale The old zoom scale factor.

newScale The new zoom scale factor.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • oldScale: all platforms
  • newScale: all platforms

Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebViewClient.onScaleChanged',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebViewClient#onScaleChanged(android.webkit.WebView,%20float,%20float)',
    ),
    IOSPlatform(
      apiName: 'UIScrollViewDelegate.scrollViewDidZoom',
      apiUrl:
          'https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom',
    ),
    WindowsPlatform(
      apiName: 'ICoreWebView2Controller.add_ZoomFactorChanged',
      apiUrl:
          'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#add_zoomfactorchanged',
    ),
  ],
)
void onZoomScaleChanged(double oldScale, double newScale) {}