Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Xamarin Form Zooming Functionality doesn't work on below Android Version 4.2 and IOS.

$
0
0

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.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>