onZoomScaleChanged method
- @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')])
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:
- Android WebView (Official API - WebViewClient.onScaleChanged)
- iOS WKWebView (Official API - UIScrollViewDelegate.scrollViewDidZoom)
- Windows WebView2 (Official API - ICoreWebView2Controller.add_ZoomFactorChanged)
Parameters - Officially Supported Platforms/Implementations:
oldScale: all platformsnewScale: 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) {}