我有一個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