Hi,
We are build Xamarin forms app with 1.3.4 version. We implemented zooming functionality but it doesn’t work on below android version 4.2. In IOS image doesn’t set in webview. We create custom render but “view.ScalesPageToFit = true” doesn’t fit image in webview.
For Android
[assembly: ExportRenderer(typeof(MyWebView), typeof(CustomWebViewRenderer))]
namespace Marcone.Droid
{
public class CustomWebViewRenderer : WebViewRenderer
{
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (Control != null)
{
Control.Settings.SupportZoom();
Control.Settings.BuiltInZoomControls = true;
Control.Settings.DisplayZoomControls = true;
}
base.OnElementPropertyChanged(sender, e);
}
}
}
Problem: Below android version 4.2 zoom in-out.
For IOS
[assembly: ExportRenderer(typeof(MyWebView), typeof(CustomWebViewRenderer))]
namespace Marcone.iOS
{
public class CustomWebViewRenderer : WebViewRenderer
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
var view = (UIWebView)NativeView;
view.ScalesPageToFit = true;
}
}
}
Problem: Image doesn’t fit in webview screen. For now large image it’s generate scroll in webview.