本文整理汇总了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;
}
示例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);
}
示例3: Show
public void Show(UIViewController parentView)
{
parentView.View.AddSubview(View);
parentView.AddChildViewController(this);
view.Show();
}
示例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);
}
示例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;
}
示例6: AttachSidebarControllerToRootController
private void AttachSidebarControllerToRootController(UIViewController rootViewController)
{
rootViewController.AddChildViewController(this);
rootViewController.View.AddSubview(this.View);
this.DidMoveToParentViewController(rootViewController);
}