更新在UITableView中先前選擇的行我試圖像這樣...在cellForRowAtIndex()如何顯示與選中標記選擇的行,而在目標C
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *[email protected]"SimpleTableViewIdentifier";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:SimpleTableViewIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:SimpleTableViewIdentifier];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.text=[hardDependencyAlldataArray objectAtIndex:indexPath.row];
return cell;
}
和以下didSelectRowAtIndexPath方法的代碼行中加入..
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheckmark;
[tableView deselectRowAtIndexPath:indexPath animated:YES];
但是,在更新以前選擇的值,查馬克沒有顯示onpreviously選擇rows..any一個可以在這個issue..Thanks幫助提前.. :)
你是什麼意思「更新以前的選定值」? – Arun
thq..for ur response .. :) .. –
以前我從表格視圖中選擇行...選擇出現選中行上的複選標記...現在我想在出發之前在先前選擇的行上顯示agian複選標記更新... –