开发者

How to add toolbar to table view in iphone apps?

开发者 https://www.devze.com 2023-02-13 19:25 出处:网络
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(FavoriteViewContr开发者_JS百科

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(FavoriteViewContr开发者_JS百科oller).

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


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消