Exemplo n.º 1
0
        /// <summary>
        /// This method is invoked when the application has loaded and is ready to run. In this
        /// method you should instantiate the window, load the UI into it and then make the window
        /// visible.
        /// </summary>
        /// <remarks>
        /// You have 5 seconds to return from this method, or iOS will terminate your application.
        /// </remarks>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            UIViewController viewController1, viewController2;

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                viewController1 = new FirstViewController("FirstViewController_iPhone", null);
                viewController2 = new SecondViewController("SecondViewController_iPhone", null);
            }
            else
            {
                viewController1 = new FirstViewController("FirstViewController_iPad", null);
                viewController2 = new SecondViewController("SecondViewController_iPad", null);
            }
            tabBarController = new UITabBarController();
            tabBarController.ViewControllers = new UIViewController [] {
                viewController1,
                viewController2,
            };

            window.RootViewController = tabBarController;
            window.MakeKeyAndVisible();

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method is invoked when the application has loaded and is ready to run. In this 
        /// method you should instantiate the window, load the UI into it and then make the window
        /// visible.
        /// </summary>
        /// <remarks>
        /// You have 5 seconds to return from this method, or iOS will terminate your application.
        /// </remarks>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            UIViewController viewController1, viewController2;
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
                viewController1 = new FirstViewController ("FirstViewController_iPhone", null);
                viewController2 = new SecondViewController ("SecondViewController_iPhone", null);
            } else {
                viewController1 = new FirstViewController ("FirstViewController_iPad", null);
                viewController2 = new SecondViewController ("SecondViewController_iPad", null);
            }
            tabBarController = new UITabBarController ();
            tabBarController.ViewControllers = new UIViewController [] {
                viewController1,
                viewController2,
            };

            window.RootViewController = tabBarController;
            window.MakeKeyAndVisible ();

            return true;
        }