Lion
Lion

Reputation: 872

How to add toolbar to table view in iphone apps?

I am developing a Window-based application in which, I added tabBarController and have table view to navigate from one table view(RootViewContoller) to another table view(FavoriteViewController).

In this table view(FavoriteViewController), I wanna add a toolBar. please aid me to overcome this problem. Thanks....

Upvotes: 0

Views: 1689

Answers (1)

Jonathan.
Jonathan.

Reputation: 55604

If your table views are in a UINavgiationController, you can set the toolbar items on the UITableViewControllers, and then set the Toolbar hidden property to NO on the navigationController:

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

where myArrayOfToolbarButtonItems is an NSArray of UIBarButtonItem, that have already been set up.

(the above code would go in your UITableViewControllers, and you can set different items for different table views that would change automatically when they are pushed)

Upvotes: 3

Related Questions