Forum Xamarin.iOS

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Basic problem - ContentPage not showing on iOS

Hi,

I'm having a very basic problem with a Forms project: I have a simple ContentPage that I try to load on both iOS and Android.
It load fine on Android, but on iOS, the page does not load and the default "Main.storyboard" that come up with the sample is showing instead.
I have attached the full project for reference.

My AppDelegate class look like this:

using Foundation;
using UIKit;

namespace consermobile.iOS
{
    [Register("AppDelegate")]
    public partial class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
    {
        private MainApp mMainApp;

        public override UIWindow Window
        {
            get;
            set;
        }

        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            Xamarin.Forms.Forms.Init();

            // Create the main application and load it
            LoadApplication(mMainApp = MainApp.mMainApp);

            return base.FinishedLaunching(uiApplication, launchOptions);
        }
    }
}

My MainApp class look like this:

using Xamarin.Forms;

namespace consermobile
{
    public class MainApp : Application
    {
        static MainApp _mainapp;
        public static MainApp mMainApp
        {
            get
            {
                if (_mainapp == null)
                {
                    _mainapp = new MainApp();
                }
                return _mainapp;
            }
        }

        public MainApp()
        {
            MainPage = new NavigationPage(new LoadingPage());
        }
    }
}

And the page I'm trying to load (LoadingPage) look like this:

using Xamarin.Forms;

namespace consermobile
{
    public partial class LoadingPage : ContentPage
    {
        public LoadingPage()
        {
            InitializeComponent();

            NavigationPage.SetHasNavigationBar(this, false);
        }
    }
}

Any idea of what really basic concept I'm missing?

Thanks for your help

Sign In or Register to comment.