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

Xamarin forms ios zoom renderer is not working , any help appreciated

$
0
0

public class CustomWebViewRenderer : ViewRenderer<CustomWebView, UIWebView>
{
protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);

        if (Control == null)
        {
            SetNativeControl(new UIWebView());
        }
        if (e.OldElement != null)
        {
            // Cleanup
        }

        if (e.NewElement != null)
        {
            var customWebView = Element as CustomWebView;
            //string fileName = Path.Combine(NSBundle.MainBundle.BundlePath, string.Format("{0}",WebUtility.UrlEncode(customWebView.Uri)));
            Control.LoadRequest(new NSUrlRequest(new NSUrl(customWebView.Uri, false)));
            //Zooming enabled
            Control.ScalesPageToFit = true;
        }
    }
}

Viewing all articles
Browse latest Browse all 89864

Trending Articles



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