Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand correctly, you want your initial ViewController to be a TabViewController and when a user selects something in one of the ViewControllers it transitions to a ViewController without the TabView buttons at the bottom.</p> <p>If so, here's what you need to do.</p> <p>In AppDelegate.cs you need to setup the window/view controllers like so:</p> <pre><code>public override bool FinishedLaunching (UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); rootController = new UINavigationController (); window.RootViewController = rootController; var tabController = new UITabBarController (); var vc1 = new TestController1(); var vc2 = new TestController2(); var vc3 = new TestController3(); tabController.ViewControllers = new UIViewController[] { vc1, vc2, vc3 }; tabController.ViewControllers [0].TabBarItem.Title = "vc1"; tabController.ViewControllers [1].TabBarItem.Title = "vc2"; tabController.ViewControllers [2].TabBarItem.Title = "vc3"; this.rootController.PushViewController(tabController, false); window.MakeKeyAndVisible (); return true; } </code></pre> <p>Once you have this setup, you can transition to a new view like so from within the class for TestController1:</p> <pre><code>public override void ViewDidLoad () { base.ViewDidLoad (); var button = UIButton.FromType(UIButtonType.RoundedRect); button.Frame = new RectangleF (10, 10, 200, 30); button.SetTitle ("Go Child Controller", UIControlState.Normal); button.TouchUpInside += (object sender, EventArgs e) =&gt; { NavigationController.PushViewController(new TestController4(), true); }; View.AddSubview (button); } </code></pre> <p>Also, you can simplify setting the tab button titles.</p> <p>Instead of doing this:</p> <pre><code>tabController.ViewControllers [0].TabBarItem.Title = "vc1"; </code></pre> <p>You can just set the title from within your child UIViewController:</p> <pre><code>public class TestController1:UIViewController { public TestController1 () { this.Title = "vc1"; } ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload