Xcode - How to add toolbar to UITableViewController

I have a little problem. I want to add a toolbar to a button on my UITableViewController, but it doesn't work. Why?

0


source to share


1 answer


If yours UITableViewController

is built in UINavigationController

, the navigation controller comes with a toolbar. You won't need to add your own.

The navigation controller navigation bar is hidden by default. You can enable it:



  • Parameter Check Shows a toolbar in the Interface Interface Attributes inspector pane, or

  • Setting the visibility of the toolbar in code:

    [self.navigationController setToolbarHidden:NO animated:YES];
    
          

Including a Storyboard toolbar has the advantage that you can drag and drop items onto it using the Interface Builder. You can also add toolbar items to your code by callingsetToolbarItems:

+1


source







All Articles