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

CALayerInvalidGeometry Exception when setting WebView.Source

$
0
0

Whenever I assign the Source property of a WebView I am hit with the exception CALayerInvalidGeometry.
This is iOS only, the same code works fine in Android

Are any of you guys getting this? If no one has a solution does anyone know where this could be happening in the WebViewRenderer where I can override?

Exception


MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: CALayerInvalidGeometry Reason: CALayer position contains NaN: [nan 240]
at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:39
at TestApp.iOS.Application.Main (System.String[] args) [0x00008] in ~/projects/testapp/iOS/Main.cs:17

Offending Code


public class FacebookPage : ContentPage
{
    private WebView webView { get; set; }

    public FacebookPage()
    {
        Title = "Facebook";
        webView = new WebView();
        Content =new StackLayout { Children =  { webView } };
    }

    protected override void OnAppearing()
    {
        base.OnAppearing();
        webView.Source = new UrlWebViewSource { Url = "https://www.facebook.com" };
    }
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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