Hello,
Welcome to our Microsoft Q&A platform!
The Android platform-specific enables pinch-to-zoom and a zoom control on a WebView. You could just set EnableZoomControls
and DisplayZoomControls
to ture in xaml as below.
<ContentPage ...
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core">
<WebView Source="https://www.xamarin.com"
android:WebView.EnableZoomControls="true"
android:WebView.DisplayZoomControls="true" />
</ContentPage>
However, the function code doesn't work for the url of your project. This is because the maximum-scale
of the url is set to 1 which means the page is not allow zooming in more than the specified amount. Simply put, the url does not support the zoom function. You could test the zoom function using the https://www.xamarin.com
url to vertify that.
<meta id="vp" name="viewport" content="minimum-scale=1, maximum-scale=1, user-scalable=no, initial-scale=1">
Check the link: https://stackoverflow.com/questions/27236676/why-does-pinch-to-zoom-not-work-in-my-android-webview
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
You could just test the code like below:
It support to scroll the content. Pelase scroll the white space instead of the screen.
Why the scroll is working only on white space? Is that also an issue with the URL?
I think it is. You could just load the url in a browser on a computer and reduce the size of the browser like below. Dragging the game page will not work, it is related to the configuration of html of the source instead of your project code.
Sign in to comment