我给了一些自定义视图UITableViewCell.accessoryView
,但是如果我疯狂滚动tableView,一些accessoryView
在iOS 7中会消失,如果我触摸单元格,它accessoryView
会出现,我不知道为什么,因为它在iOS 6中是正确的。这是我的代码,有人可以帮助我吗?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [NSString stringWithFormat:@"CELL %d", (int)indexPath.row+1];
NSDictionary * dict = [_dataSource objectAtIndex:indexPath.row];
if ([dict objectForKey:@"switch"])
{
cell.accessoryView = [dict objectForKey:@"switch"];
}
else
{
cell.accessoryView = nil;
}
return cell;
}