にいくつかのカスタム ビューを割り当てます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;
}