UIToolbar in UINavigationController not showing any items

Discussion in 'iOS Programming' started by Bruno Silva, Jun 12, 2010.

  1. Bruno Silva macrumors newbie

    Sep 2, 2008
    Hi, I'm fairly new to iOS development.

    I have a NavigationView Based app with two UITableViews and several other normal views. The navigation goes from the first table to the second and then to a third view. I use Push and Pop to change views in the NavigationViewController. I tried to set a toolbar only on the second view with the table. However, I can't make the UIBarButtonItems to show on the toolbar, I think it doesn't have anything to do with the items I create because if I associate them to the navigation bar left or right button they work great.

    This is the code I use to set the toolbarItems:

    [self.navigationController setToolbarHidden:NO];
    [self.navigationController setToolbarItems:[NSArray	arrayWithObjects:
    	editButton, flexSpacer, filterControl	, nil]
    This code runs in the ViewDidLoad method.

    I'm trying to understand why this doesn't work, any help is appreciated, thanks!

    Bruno Silva
  2. Bruno Silva thread starter macrumors newbie

    Sep 2, 2008
    Found the answer, I knew I had to set the navbar items in the navcontroller, and I assumed it was the same for the toolbar, but it is not, you need to set it on whatever UIViewController you're showing :)


Share This Page