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


C# UIViewController.AddChildViewController方法代码示例

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


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

示例1: FinishedLaunching

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

			root = new UIViewController ();
			vc1 = new ViewController1 ();
			root.View.AddSubview (vc1.View);

			vc1.InitialActionCompleted += (object sender, EventArgs e) => {

				vc1.View.RemoveFromSuperview ();

				tabController = new UITabBarController ();

				vc2 = new ViewController2 ();
				vc3 = new ViewController3 ();

				tabController.ViewControllers = new UIViewController[] {
					vc1,
					vc2,
					vc3
				};
				tabController.ViewControllers [0].TabBarItem.Title = "One";
				tabController.ViewControllers [1].TabBarItem.Title = "Two";
				tabController.ViewControllers [2].TabBarItem.Title = "Three";

				root.AddChildViewController (tabController);
				root.Add (tabController.View);
			};

			window.RootViewController = root;
			window.MakeKeyAndVisible ();
            
			return true;
		}
开发者ID:eduardoguilarducci,项目名称:recipes,代码行数:35,代码来源:AppDelegate.cs

示例2: InvoiceBottomView

 public InvoiceBottomView(UIViewController parent)
 {
     BackgroundColor = UIColor.LightGray;
     tabbar = new UITabBarController () {
         ViewControllers = new UIViewController[] {
             coupons = new QuickItemsViewController{
                 TabBarItem = new UITabBarItem ("Offers", UIImage.FromBundle ("coupon"), 0),
                 ItemBackgroundColor = Color.Red,
                 AlternateItemBackgroundColor = Color.Olive,
                 Title = "Offers",
                 Sections = 2,
                 GetItems = WebService.Main.GetGroupedCoupons,
                 AddItem = (i) =>{
                     if(AddItem != null)
                         AddItem(i);
                 },
             },
             newProduct = new QuickItemsViewController{
                 TabBarItem = new UITabBarItem ("New Product", UIImage.FromBundle ("newProduct"), 1),
                 ItemBackgroundColor = Color.Orange,
                 AlternateItemBackgroundColor = Color.Orange,
                 Title = "New Product",
                 GetItems = (s) => WebService.Main.GetNewProducts(),
                 AddItem = (i) =>{
                     if(AddItem != null)
                         AddItem(i);
                 },
             },
         },
     };
     NotificationCenter.Shared.CouponsChanged += () => coupons.ReloadData ();
     NotificationCenter.Shared.NewProductChanged += () => newProduct.ReloadData ();
     AddSubview (tabbar.View);
     parent.AddChildViewController (tabbar);
 }
开发者ID:nagyist,项目名称:iPadPos,代码行数:35,代码来源:InvoiceBottomView.cs

示例3: Show

		public void Show(UIViewController parentView)
		{

			parentView.View.AddSubview(View);
			parentView.AddChildViewController(this);
			view.Show();
		}
开发者ID:stecenko,项目名称:MyCompany,代码行数:7,代码来源:PopupViewController.cs

示例4: SidebarController

        /// <summary>
        /// Contructor.
        /// </summary>
        /// <param name="contentAreaController">
        /// The view controller for the content area.
        /// </param>
        /// <param name="navigationAreaController">
        /// The view controller for the side menu.
        /// </param>
        public SidebarController(UIViewController rootViewController, UIViewController contentAreaController, UIViewController navigationAreaController)
        {
            Initialize(contentAreaController, navigationAreaController);

            // handle wiring things up so events propogate properly
            rootViewController.AddChildViewController(this);
            rootViewController.View.AddSubview(this.View);
            this.DidMoveToParentViewController(rootViewController);
        }
开发者ID:GSerjo,项目名称:Xamarin-Sidebar,代码行数:18,代码来源:SidebarController.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)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			SlidingPanelsNavigationViewController navController = new SlidingPanelsNavigationViewController(new ExampleContentA ());

			UIViewController rootController = new UIViewController ();
			rootController.AddChildViewController (navController);
			rootController.View.AddSubview (navController.View);

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

			navController.InsertPanel (new LeftPanelContainer(new LeftPanelViewController (navController)));
			navController.InsertPanel (new RightPanelContainer(new RightPanelViewController (navController)));
			navController.InsertPanel (new BottomPanelContainer(new BottomPanelViewController (navController)));

			return true;
		}
开发者ID:caseyjb,项目名称:SlidingPanels.Touch,代码行数:26,代码来源:AppDelegate.cs

示例6: AttachSidebarControllerToRootController

 private void AttachSidebarControllerToRootController(UIViewController rootViewController)
 {
     rootViewController.AddChildViewController(this);
     rootViewController.View.AddSubview(this.View);
     this.DidMoveToParentViewController(rootViewController);
 }
开发者ID:l3ender,项目名称:Xamarin-Sidebar,代码行数:6,代码来源:SidebarController.cs


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