我有一个UITableViewController,我想用一个按钮添加UIToolbar。在的UITableViewController的如何将uitoolbar添加到uitableviewcontroller?
- (void)viewDidLoad;
方法,我有:
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(pressButton1:)];
self.navigationItem.title = @"Some title";
self.navigationItem.leftBarButtonItem = button;
}
不幸的是我没有看到工具栏,当我运行我的应用程序。 任何提示?我应该做更多的事吗?
就是这样!我不知道我需要创建UINavigationItem。我认为UITableView已经有一个。谢谢@FenchKiss开发! – Jakub 2010-03-29 19:21:18