当前位置: 首页>>代码示例>>C#>>正文


C# UINavigationController.PushViewController方法代码示例

本文整理汇总了C#中UINavigationController.PushViewController方法的典型用法代码示例。如果您正苦于以下问题:C# UINavigationController.PushViewController方法的具体用法?C# UINavigationController.PushViewController怎么用?C# UINavigationController.PushViewController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UINavigationController的用法示例。


在下文中一共展示了UINavigationController.PushViewController方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create our window
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			
			// are we running an iPhone or an iPad?
			DetermineCurrentDevice ();

			// instantiate our main navigatin controller and add it's view to the window
			mainNavController = new UINavigationController ();
			
			switch (CurrentDevice)
			{
				case DeviceType.iPhone:
					iPhoneHome = new HandlingRotation.Screens.iPhone.Home.HomeScreen ();
					mainNavController.PushViewController (iPhoneHome, false);
					break;
				
				case DeviceType.iPad:
					iPadHome = new HandlingRotation.Screens.iPad.Home.HomeScreenPad ();
					mainNavController.PushViewController (iPadHome, false);
					break;
			}

			window.RootViewController = mainNavController;

			return true;
		}
开发者ID:7sharp9,项目名称:monotouch-samples,代码行数:29,代码来源:AppDelegate.cs

示例2: FinishedLaunching

		//
		// 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.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			userDao = new UserDao ();
			courseDao = new CourseDao ();
			this.window = new UIWindow (UIScreen.MainScreen.Bounds);
			var rootNavigationController = new UINavigationController ();

			if (userDao.tokenExists () && courseDao.existCourses ()) 
			{
				CoursesViewController courseView = new CoursesViewController();
				rootNavigationController.PushViewController(courseView,false);
			} 
			else 
			{
				MonoMobilisViewController loginView = new MonoMobilisViewController();
				rootNavigationController.PushViewController(loginView,false);
			}

			//MonoMobilisViewController loginView = new MonoMobilisViewController();
			//rootNavigationController.PushViewController(loginView,false);

			this.window.RootViewController = rootNavigationController;
			this.window.MakeKeyAndVisible();
			ServiceLocator.Dispatcher = new DispatchAdapter(this);
			return true;
		}
开发者ID:paulombcosta,项目名称:mono-mobilis,代码行数:33,代码来源:AppDelegate.cs

示例3: FinishedLaunching

        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Console.WriteLine ("AppDelegate.FinishedLaunching");
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            var nc = new UINavigationController ();
            navigation_controller = nc;
            var lvc = new LoginSettingsViewController () { AppDelegate = this };
            nc.PushViewController (lvc, false);

            room_list_controller = new UITableViewController ();
            room_controller = new UITableViewController ();

            nc.TopViewController.Title = "MonoTouchLingr";
            window.AddSubview (nc.View);
            window.MakeKeyAndVisible ();

            if (File.Exists (cfgfile)) {
                string [] lines = File.ReadAllLines (cfgfile);
                //Login (lines [0], lines [1]);
                lvc.ViewLoaded += delegate {
                    lvc.UserName = lines [0];
                    lvc.Password = lines [1];
                };
            }
            return true;
        }
开发者ID:atsushieno,项目名称:slingr,代码行数:27,代码来源:Main.cs

示例4: FinishedLaunching

        //
        // 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.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

            //---- instantiate a new navigation controller
            var rootNavigationController = new UINavigationController();

            //---- instantiate a new home screen
            HomeScreen homeScreen = new HomeScreen();

            //---- add the home screen to the navigation controller
            // (it'll be the top most screen)
            rootNavigationController.PushViewController(homeScreen,false);

            //---- set the root view controller on the window. the nav
            // controller will handle the rest
            this.window.RootViewController = rootNavigationController;
            // make the window visible
            this.window.MakeKeyAndVisible ();
            return true;
        }
开发者ID:khaledsaied,项目名称:Codes,代码行数:32,代码来源:AppDelegate.cs

示例5: FinishedLaunching

		//
		// 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.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{

			FBSettings.DefaultAppID = AppId;
			FBSettings.DefaultDisplayName = DisplayName;
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			rootNavigationController = new UINavigationController ();
			CAGradientLayer degradado = new CAGradientLayer ();
			degradado.Frame = (rootNavigationController.NavigationBar.Bounds);
			UIGraphics.BeginImageContext (rootNavigationController.NavigationBar.Bounds.Size);
			degradado.Colors = new CGColor[] { UIColor.FromRGB (62, 92, 41).CGColor, UIColor.FromRGB (132, 194, 71).CGColor };
			degradado.RenderInContext (UIGraphics.GetCurrentContext());
			UIImage bgDegradado = UIGraphics.GetImageFromCurrentImageContext ();
			UIGraphics.EndImageContext ();
			rootNavigationController.NavigationBar.TintColor = UIColor.White;
			UIStringAttributes atributes = new UIStringAttributes();
			atributes.ForegroundColor = UIColor.White;
			rootNavigationController.NavigationBar.TitleTextAttributes = atributes;

			rootNavigationController.NavigationBar.SetBackgroundImage (bgDegradado, UIBarMetrics.Default);

			// If you have defined a root view controller, set it here:
			// window.RootViewController = myViewController;
			mainView = new MainView ();
			rootNavigationController.PushViewController (mainView,false);

			// make the window visible
			window.RootViewController = rootNavigationController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:saedaes,项目名称:ProductFinder,代码行数:40,代码来源:AppDelegate.cs

示例6: FinishedLaunching

        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Current = this;

            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            // make the window visible
            window.MakeKeyAndVisible ();

            TodoContractMngr = new TodoContractManager("http://40.118.255.235:8000",
                "http://40.118.255.235/eth/v1.2");

            // create our nav controller
            navController = new UINavigationController ();

            // create our Todo list screen
            homeViewController = new Screens.HomeScreen ();

            // push the view controller onto the nav controller and show the window
            navController.PushViewController(homeViewController, false);
            window.RootViewController = navController;
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:charlescrain,项目名称:xamarin-sample-app,代码行数:26,代码来源:AppDelegate.cs

示例7: LagerMasterView

        public LagerMasterView()
            : base()
        {
            LagerList primaryview;
            TheStorageScreen secondaryview;

            UINavigationController primarynav;
            UINavigationController secondarynav;

            primaryview = new LagerList();
            secondaryview = new TheStorageScreen();

            primaryview.LagerClicked += (object sender, LagerClickedEventArgs e) => secondaryview.ShowDetails (e.Lager);

            secondaryview.LagerSaved += delegate(object sender, LagerClickedEventArgs e) {
                primaryview.Refresh();
            };

            primarynav = new UINavigationController();
            primarynav.PushViewController(primaryview, false);

            secondarynav = new UINavigationController();
            secondarynav.PushViewController(secondaryview, false);

            ViewControllers = new UIViewController[] {primarynav, secondarynav};
        }
开发者ID:Skalar,项目名称:Indexer,代码行数:26,代码来源:LagerMasterView.cs

示例8: ViewDidLoad

        public override void ViewDidLoad()
        {
            _favoritesViewController = new FavoritesViewController();

            UINavigationController favoritesNavController = new UINavigationController();
            favoritesNavController.TabBarItem = new UITabBarItem(UITabBarSystemItem.Favorites, 0);
            favoritesNavController.PushViewController(_favoritesViewController, false);

            _mostRecentViewController = new MostRecentViewController();
            UINavigationController mostRecentNavController = new UINavigationController();
            mostRecentNavController.TabBarItem = new UITabBarItem(UITabBarSystemItem.MostRecent, 1);
            mostRecentNavController.PushViewController(_mostRecentViewController, false);

            _allStopsViewController = new AllStopsViewController();

            UINavigationController allStopsNavController = new UINavigationController();
            allStopsNavController.TabBarItem = new UITabBarItem("Alle stopp", null, 2);
            allStopsNavController.PushViewController(_allStopsViewController, false);

            var tablist = new UIViewController[]
            {
               favoritesNavController, mostRecentNavController, allStopsNavController
            };

            ViewControllers = tablist;
        }
开发者ID:runegri,项目名称:MuPP,代码行数:26,代码来源:TabBarController.cs

示例9: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			// make the window visible
			window.MakeKeyAndVisible ();
			// create our nav controller
			navController = new UINavigationController ();
			// create our Todo list screen
			homeViewController = new Screens.HomeScreen ();
			//			UIApplication.SharedApplication.KeyWindow.TintColor = UIColor.White;
			//			navController.NavigationBar.BarTintColor = UIColor.FromRGB (0x91, 0xCA, 0x47);
			// green theme
			//			navController.NavigationBar.TintColor = UIColor.White;
			//			navController.NavigationBar.BarTintColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E);
			navController.NavigationBar.TintColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E);
			// 6FA22E dark-green
			navController.NavigationBar.BarTintColor = UIColor.FromRGB (0xCF, 0xEF, 0xA7);
			// CFEFA7 light-green
			UINavigationBar.Appearance.SetTitleTextAttributes (new UITextAttributes () {
				//				TextColor = UIColor.White,
				TextColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E),
				// 6FA22E dark-green
				TextShadowColor = UIColor.Clear
			});
			// push the view controller onto the nav controller and show the window
			navController.PushViewController (homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			return true;
		}
开发者ID:tbrown0139,项目名称:What-a-task,代码行数:31,代码来源:AppDelegate.cs

示例10: FinishedLaunching

        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            root = new RootElement ("Dropbox Chooser Demo") {
                new Section{
                    new StringElement("Preview", delegate {
                        ChooseFile(DBChooserLinkType.Preview);
                }),
                    new StringElement("Direct Dowload", delegate {
                        ChooseFile(DBChooserLinkType.Direct);
                })
                },

                //This section is used to show results metadata
                new Section("Metadata"),

                //This section used to show link and thumbnails
                new Section("Links and Thumbnails")

            };

            var dv = new DialogViewController (root);
            navigation = new UINavigationController ();
            navigation.PushViewController (dv, true);

            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
                window.RootViewController = navigation;
            else
                window.AddSubview (navigation.View);

            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:prashantvc,项目名称:monotouch-bindings,代码行数:35,代码来源:AppDelegate.cs

示例11: FinishedLaunching

        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
			if(Game == null)
				throw new InvalidOperationException("Please set 'Game' to a valid instance of Game before calling this method.");
				
            var bounds = UIScreen.MainScreen.Bounds;

            // create the game main windows
            MainWindow = new UIWindow(bounds);

            var xenkoGameView = CreateView(bounds);

            var xenkoGameController = CreateViewController(xenkoGameView);

            // create the game context
            var gameContext = new GameContextiOS(new iOSWindow(MainWindow, xenkoGameView, xenkoGameController));

            // Force fullscreen
            UIApplication.SharedApplication.SetStatusBarHidden(true, false);

            // Added UINavigationController to switch between UIViewController because the game is killed if the FinishedLaunching (in the AppDelegate) method doesn't return true in 10 sec.
            var navigationController = new UINavigationController {NavigationBarHidden = true};
            navigationController.PushViewController(gameContext.Control.GameViewController, false);
            MainWindow.RootViewController = navigationController;

            // launch the main window
            MainWindow.MakeKeyAndVisible();

            // launch the game
            Game.Run(gameContext);

            return Game.IsRunning;
        }
开发者ID:cg123,项目名称:xenko,代码行数:33,代码来源:XenkoApplicationDelegate.iOS.cs

示例12: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			navController = new UINavigationController ();

			// create our home controller based on the device
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				homeViewController = new Screens.HomeScreen();
			} else {
// sample does not contain an iPad UI
//				homeViewController = new Screens.iPadHomeScreen ();
			}
			
			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:BeardAnnihilator,项目名称:xamarin-samples,代码行数:26,代码来源:AppDelegate.cs

示例13: FinishedLaunching

        //
        // 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.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            viewController = new UINavigationController ();
            viewController.PushViewController(new MainScreenGroup(), true);
            viewController.NavigationBar.Opaque = true;

            window.MakeKeyAndVisible ();

            #if LITE
            AdManager.LoadBanner();
            #endif

            // On iOS5 we use the new window.RootViewController, on older versions, we add the subview
            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
                window.RootViewController = viewController;
            else
                window.AddSubview (viewController.View);

            #if LITE
            Apprater = new Appirater(527002436);
            #else
            Apprater = new Appirater(526844540);
            #endif
            Apprater.AppLaunched();
            return true;
        }
开发者ID:zekiller3,项目名称:SMSParty,代码行数:35,代码来源:AppDelegate.cs

示例14: FinishedLaunching

		//
		// 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.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			var web = new WebElement ();
			web.HtmlFile = "instructions";

			var root = new RootElement ("Kannada Keyboard") {
				new Section{
					new UIViewElement("Instruction", web.View, false)
				}
			};
		
			var dv = new DialogViewController (root) {
				Autorotate = true
			};
			var navigation = new UINavigationController ();
			navigation.PushViewController (dv, true);				

			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			window.AddSubview (navigation.View);
			
			return true;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:33,代码来源:AppDelegate.cs

示例15: OnElementChanged

		protected async override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			navigation = NavigationController;

			window = new UIWindow(UIScreen.MainScreen.Bounds);

			//This is the class which actually implements the component a couple of elements to make it work
			viewController = new JSQmessages(); 


			//sender is a public field of JSQmessages and it is populated using the public fields we defined in the orginal forms ChatPage.
			viewController.sender = new User (){ Id = ChatPage.senderID, DisplayName = ChatPage.senderName };

			viewController.View.Frame = this.View.Frame;

			navigationController = new UINavigationController();
			navigationController.PushViewController(viewController, false);

			AddChildViewController (viewController);

			/*the Frame is smaller than the entire screen, this lets us still retain the original Navigation bar from Xamarin Forms, 
			 * so it's easy to dismiss the page from the view hierarchy if we retain the navbar that forms created for us */
			viewController.View.Frame = new CGRect(this.View.Frame.X,this.View.Frame.Y,this.View.Bounds.Width,this.View.Bounds.Height - 64f);
			this.View.AddSubview (viewController.View);
			this.DidMoveToParentViewController (viewController); 



		} 
开发者ID:rlingineni,项目名称:Xamarin.Forms-ChatMessenger,代码行数:31,代码来源:ChatPageRenderer.cs


注:本文中的UINavigationController.PushViewController方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。