2012-07-31 54 views
1

你好朋友我是新来的TableView .....我想帮忙..请问如何在点击每行时设置navigatonitem的标题?

我必须在导航栏上设置标题,当我点击每一行时我应该在naviagtionbar上得到同一行的名字......朋友,我在我的表23行,所以请建议我让我的问题解决了,请......

感谢& REGA

回答

1

tableView:didSelectRowForIndexPath:,写代码如下:上后退按钮

self.title = [NSString stringWithFormat:@"Cell%d",indexPath.row]; 
+1

YAA工作...感谢 – 2012-07-31 08:44:51

+0

其显示单行标题... – alex 2012-07-31 09:49:54

+0

你好亚历克斯,你可以自定义设置后退按钮就可以了BTN = UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(280,0,32,31); [btn addTarget:self action:@selector(back :) forControlEvents:UIControlEventTouchUpInside]; [btn setImage:[UIImage imageNamed:@“back_btn.png”] forState:UIControlStateNormal]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn]; – 2012-07-31 13:21:19

0

tableView:didSelectRowForIndexPath:尝试self.title = nameoftherow; [self.view setNeedsDisplay];

相关问题