目前,我有一個UITableView
和2行。如圖所示。它由一個數組在ViewDidLoad
中設置。禁用UITableViewController的第二行
viewDidLoad中
- (void)viewDidLoad {
[super viewDidLoad];
self.title = NSLocalizedString(@"Analysis", @"Badminton Analysis Tool");
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects:@"Statistical Analysis", @"Graphical Analysis", nil];
self.booksArray = array;
}
didSelectRowAtIndexPath方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSInteger row = [indexPath row];
if (self.statViewController == nil) {
StatViewController *statDetail = [[StatViewController alloc] initWithNibName:@"StatViewController" bundle:nil];
self.statViewController = statDetail;
}
statViewController.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]];
[self.navigationController pushViewController:statViewController animated:YES];
}
此刻,當我點擊任一列,它推到我只打算了同樣的觀點爲'統計分析'。我想禁用點擊進行圖形分析。我如何禁用'圖形分析'的選擇?
謝謝。
嗨,我該如何在上面的代碼中實現?謝謝。 –
你必須將它添加到你的UITableView的委託類中。 – 2012-04-30 14:36:12
不錯,它的作品。謝謝。但是當我點擊第二排時,它有時會閃爍。當我嘗試點擊第二行時,如何禁用藍色閃光燈? –