【发布时间】:2009-11-24 04:11:54
【问题描述】:
所以,在将视图控制器推送到我的 tableView 之后,
// 覆盖以支持表格视图中的行选择。 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // 导航逻辑可能会在这里 -- // 例如,创建并推送另一个视图控制器。 另一个视图控制器 *另一个视图控制器 = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; [self.navigationController pushViewController:anotherViewController 动画:YES];好的,这样就可以滑动另一个视图,您可以通过单击自动出现在左上角的按钮返回上一个视图(“弹出”当前视图)现在导航栏。
好的,所以说我想在导航栏的右侧填充一个完成按钮,就像在 iPhone 附带的“Notes”应用程序中一样。我该怎么做?
我试过这样的代码:
UIBarButtonItem * doneButton = [[UIBarButtonItem 分配] initWithBarButtonSystemItem:UIBarButtonSystemItemDone 目标:自己 动作:@selector(doneFunc)]; self.navigationController.navigationItem.rightBarButtonItem = doneButton ; // 不是.. [完成按钮释放] ;doneFunc 已定义,一切,只是按钮永远不会出现在右侧..
【问题讨论】:
标签: iphone uinavigationcontroller