Navigation controllers in each tab of a TabBarController

Programmer16Programmer16 USMember ✭✭

Hi all,

I'm scratching my head at how to do this.. I'm currently trying to have a separate navigation controller within each of my tabs of a TabBarController. For simplicities sake, let's for this example use a single tab (and I can copy this to other tabs). How do I reference/add a separate navigation controller in my tab? This is my storyboard

TabBarController -> NavigationController -> UITableViewController

In my UITableViewController I have this code, but it doesn't show the button, nor change the title, so I feel I have something setup wrong. Any advice is greatly thanked

public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        Console.WriteLine("view did load");
        Title = "My custom title";

        NavigationItem.SetRightBarButtonItem(
            new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, args) =>
            {
                PerformSegue("CreateRecordSegue", this);
            })
        , true);
    }

Best Answer

  • Programmer16Programmer16 US ✭✭
    Accepted Answer

    In this case, removing the navigation controller before the tabbar controller fixes this.

Answers

  • Programmer16Programmer16 USMember ✭✭

    This is the storyboard for the question

  • Programmer16Programmer16 USMember ✭✭
    Accepted Answer

    In this case, removing the navigation controller before the tabbar controller fixes this.

Sign In or Register to comment.