[英]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
). 我正在开发一个基于Windows的应用程序,在其中添加了tabBarController并具有表视图,可以从一个表视图( RootViewContoller
)导航到另一表视图( FavoriteViewController
)。
In this table view( FavoriteViewController
), I wanna add a toolBar. 在此表视图( FavoriteViewController
)中,我想添加一个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: 如果您的表视图位于UINavgiationController中,则可以在UITableViewControllers上设置工具栏项,然后在navigationController上将Toolbar hidden属性设置为NO:
[self setToolbarItems:myArrayOfToolbarButtonItems];
[self.navigationController setToolbarHidden:NO animated:YES];
where myArrayOfToolbarButtonItems
is an NSArray
of UIBarButtonItem
, that have already been set up. 其中myArrayOfToolbarButtonItems
是NSArray
的UIBarButtonItem
,已经被建立。
(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) (上面的代码将放在您的UITableViewControllers中,并且您可以为不同的表视图设置不同的项目,这些项目在按下时会自动更改)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.