我是 iOS 开发新手, Storyboard中只有 UITableViewController
。我想用一些按钮向它添加一个顶部栏,该怎么做?
注意,我正在使用由“Storyboard”创建的 UITabBar,而我的 ITableViewController 是 UITabBar 的一项。
最佳答案
当您创建 UITableViewController
时,请执行以下操作:
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:tableViewController];
然后不是将 TableView Controller 设置为 View ,而是将其设置为导航 Controller 。在您的 TableView Controller 中,您可以将导航栏的左右按钮设置为 UIBarButtonItem
(如果您想知道如何操作,请问我)。
关于ios - 初学者 : How to add top bar with buttons on UITableViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9415704/