async protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Forms.Forms.Init(this, bundle); SplashPage splashPage = new SplashPage("@drawable/splash"); FormsApp formsApp = new FormsApp(); MXFormsContainer.Initialize(formsApp, formsApp.NavigationPage, (t) => { Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { //SetPage(formsApp.NavigationPage); }); }); MXFormsContainer.AddView <Home>(typeof(HomePage), ViewPerspective.Default); MXFormsContainer.AddView <About>(typeof(AboutPage), ViewPerspective.Default); await MXFormsContainer.Navigate("Home"); SetPage(formsApp.NavigationPage); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Forms.Init(); window = new UIWindow(UIScreen.MainScreen.Bounds); FormsApp formsApp = new FormsApp(); var vc = formsApp.NavigationPage.CreateViewController(); window.RootViewController = vc; window.MakeKeyAndVisible(); string splashImage = "Default"; if (UIScreen.MainScreen.Bounds.Height == 568) { splashImage = String.Format("{0}-568h", splashImage); } var splashPage = new SplashPage(splashImage); vc.PresentViewController(splashPage.CreateViewController(), false, null); MXFormsContainer.Initialize(formsApp, formsApp.NavigationPage, (t) => { this.InvokeOnMainThread(() => { vc.DismissViewController(true, null); }); }); MXFormsContainer.AddView <Home>(typeof(HomePage), ViewPerspective.Default); MXFormsContainer.AddView <About>(typeof(AboutPage), ViewPerspective.Default); MXFormsContainer.Navigate("Home"); return(true); }