Forum Xamarin.iOS

WebView is Blank

I am making a project using Xamarin.Mac. For some reason the Webview is not loading. I tried checking the code on a real mac project and it worked fine. Here is the code I am using:

webBrowser1.MainFrame.LoadRequest( new NSUrlRequest(new NSUrl("")));

Please help me with this.



  • MikeCodesDotNetMikeCodesDotNet GBXamarin Team Xamurai


    You should be able to do something like the following:

    webView.MainFrameUrl = "";

    I hope this helps.

  • MohamadYaghmourMohamadYaghmour LBMember


    I already tried that before and it is still blank..

  • MohamadYaghmourMohamadYaghmour LBMember

    Also for some reason in the XCode .xib file. I am getting this error.
    "Unknown name type WebView"

  • MikeCodesDotNetMikeCodesDotNet GBXamarin Team Xamurai

    I've gone ahead and put together a sample App that demonstrates this working for you.

    You can download it here:

    If the above doesn't compile and run for you, could you let me know what version of our tools you have installed? To get this, please do the following:

    Xamarin Studio > About Xamarin Studio > Show Details > Copy Information

    All the best,

  • MohamadYaghmourMohamadYaghmour LBMember

    Thanks a lot Michael. I tried something else in the same project. I inserted another WebView to the main window of the application and it works fine. The problem I am facing is when I am opening the window as a dialog.

                using(var modalWindowCtl = new TwitterPinController()) {
                    modalWindowCtl.validationUrl = "";

    And in TwitterPinController.cs on a button click action I am calling this function

                this.mywebview.FinishedLoad += delegate {
                    String was_redirected_to_url = mywebview.MainFrameUrl.ToString ();
                    Console.WriteLine ("in OnFinishedLoad, landed at: " + was_redirected_to_url);
                this.mywebview.MainFrameUrl = validationUrl;

    What made me think that the problem is from the modal window is that when I am closing that window the FinishedLoad function is returning.

    What could be the problem causing this ?

  • MohamadYaghmourMohamadYaghmour LBMember

    Anyone ?

Sign In or Register to comment.