UIToolbar in UINavigationController not showing any items

Discussion in 'iPhone/iPad Programming' started by Bruno Silva, Jun 12, 2010.

  1. macrumors newbie

    Joined:
    Sep 2, 2008
    Location:
    Portugal
    #1
    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:

    Code:
    [self.navigationController setToolbarHidden:NO];
    [self.navigationController setToolbarItems:[NSArray	arrayWithObjects:
    	editButton, flexSpacer, filterControl	, nil]
    animated:NO];
    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. thread starter macrumors newbie

    Joined:
    Sep 2, 2008
    Location:
    Portugal
    #2
    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 :)

    Bruno.
     

Share This Page