New Empty Project
Add a Mainstoryboard
Set Startup item to Mainstoryboard
Overriding the window method of Appdelegate
public override UIWindow Window { get; Set; }
Drag 3 View Controllers controls from the toolbox, and set the identity class to Viewcontroller1,viewcontroller2,viewcontroller3 respectively.
ViewController1 Add control lable, Button,button name is Abutton
ViewController2 add lable text to two,viewcontroller3 add lable text to three
The events for setting Abutton are as follows
Adding Methods in ViewController1.cs
partial void initialactioncompleted (UIButton sender) { Abutton.hidden = true; }
public override void ViewDidLoad (){ if (ParentViewController != null){ aButton.Hidden = true; }}
Remove the extra two viewcontoller from the Toolbox by dragging a tab Bar Controller
Hold down CTRL, Abutton the tab bar controller, hold down CTRL and drag the mouse from the tab bar controller to the Viewcontroller1,viewcontroller2, ViewController3
The menu that appears during the drag process
Click Tab or modal
The final result is as follows
Tabs in Non-rootviewcontroller Scenarios