Benches iPhone

1

iPhone - Adding UINavigationBar to UITableView

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi -

I'm sure this is a dumb question, but I have a UITableView that I create programmatically. I need to create a custom navigation bar and put it on top of the UITableView. Is there an easy way to do this programatically?

Also, the UITableView is loaded within a UITabBarController. In other words, when you select a tab on the UITabBarController, it loads a UITableView which I create programatically. The UITabBarController is created through IB. I want to have a custom UINavigationBar on the View that is loaded by UITabBarController.

Was that clear at all?

How stupid is this setup already?

1 reply

Sign in or join Beachball Help to reply.

  1. 0

    just.do.it

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi, there are two possible ways

    1. If you want the navigationBar to apear at each view use


    UINavigationController
    |
    `-> RootViewControler = UITabBarController
    |
    `-> viewControllers[0] = UITableViewController

    2. If you want the navigationBar to apear together with the tableView only use:


    UITabBarController
    |
    `-> viewControllers[0] = UINavigationController
    |
    `-> rootviewController = UITableViewController