What could be the cause of a HTML page loaded over HTTPS with CSS transformations and JavaScript that uses “swiping” to not work in a Xamarin.Forms Android WebView custom renderer?
The page works fine in: Chrome on Android, Xamarin.Android WebView, Xamarin.Forms WebView.
Only when using a WebView custom renderer on Android according to the official tutorial does the page stop working.
Specifically, it's pages like these that fail to work for some reason: https://www.irozhlas.cz/fotogalerie/7693434?fid=8301190
Found another type of pages that doesn't display correctly in an Android WebView custom renderer: https://www.irozhlas.cz/ekonomika/kalkulacka-socialni-davky-exekuce_1811280900_jab – this leads me to believe it's a CSS issue, not a JS one.
I understand this is quite a narrow scope, but I'm sure others must have run into similar problems.
I have tried:
No relevant errors or warnings seem to appear in the log.
Remote debugging on Chrome: there are no warnings or signs of why it wouldn't work. I wasn't able to find the cause in the page's JS or CSS.
Updating the Xamarin.Forms package.
Setting HttpClient implementation to Android (AndroidClientHandler).
The following, gathered from other Stack Overflow answers and other places, but it doesn't make a difference:
webView.Settings.SetAppCacheEnabled(true); webView.Settings.DomStorageEnabled = true; webView.Settings.DatabaseEnabled = true; webView.Settings.LoadWithOverviewMode = true; webView.Settings.AllowFileAccess = true; webView.Settings.AllowContentAccess = true; webView.Settings.UseWideViewPort = true; webView.Settings.BuiltInZoomControls = true; webView.Settings.DisplayZoomControls = false; webView.Settings.SetSupportZoom(true); webView.Settings.DefaultTextEncodingName = "utf-8"; webView.SetWebViewClient(new WebViewClient()); webView.SetWebChromeClient(new WebChromeClient());
Using Xamarin.Forms with a custom renderer for the WebView should have been the equivalent of using Xamarin.Android, but upon further investigation, a Xamarin.Android project with a WebView works fine with the page, and so does the default Xamarin.Forms WebView, thus this seems to be a Xamarin.Forms WebView custom renderer specific problem.