0
我有一個奇怪的問題,我的UITableView。我希望表格中的所有單元格都是可選的,這樣如果選擇一個單元格,就會執行相應的操作。我的表格中的所有單元格當前都可以從第0行的單元格中選擇(單元格出現在表格的頂部)。這個單元格是不可選擇的,即使它已被設置爲允許選擇。有任何想法嗎?iPhone編碼:與UITableView選擇問題
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
tableView.allowsSelection = YES;
static NSString *SettingsTableID = @"SettingsTableID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SettingsTableID];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
reuseIdentifier: SettingsTableID] autorelease];
}
cell.textLabel.text = [tableHeadingsArray objectAtIndex:row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
非常感謝。
可以üPLZ後你的didSelectRowAtIndexPath:代碼??? – KingofBliss 2010-12-01 17:27:53