Skip to content

How to Enable Zoom Feature for BlazorWebView MAUI Hybrid on Android? #26471

Discussion options

You must be logged in to vote

@thinhdo-developer @jfversluis You can use like this:

Android:

PAGE SAMPLE
<BlazorWebView HostPage="wwwroot/index.html" x:Name="webView" BlazorWebViewInitialized="OnBlazorWebViewInitialized"> <BlazorWebView.RootComponents> <RootComponent x:Name="blazorWebView" Selector="#app" ComponentType="{x:Type components:MyComponent}"/> </BlazorWebView.RootComponents> </BlazorWebView>

CODE
private void OnBlazorWebViewInitialized(object sender, BlazorWebViewInitializedEventArgs e) { #if ANDROID e.WebView.Settings.DisplayZoomControls = false; e.WebView.Settings.BuiltInZoomControls = true; e.WebView.Settings.SetSupportZoom(true); #endif }

iOS:

Index.html
Change de viewport to enable
Sample:
<meta name="…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jfversluis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #26457 on December 09, 2024 08:19.