views:

22

answers:

1

I have a UITableView with 3 sections. 2 of the sections are fixed in that when in edit mode, no additional rows can be added or deleted, therefore only 1 of the 3 sections show the green plus/red minuses, however the rows in all three section animate to a narrow width to accommodate the plus and minus for the single section that can be edited, the other 2 revealing only space.

Is there any way to prevent these 2 sections from doing the narrow animating thing? This would only be for cosmetic purposes but I think it'll look better.

Thanks

A: 

I was able to find the answer.

From the UITableViewDataSource Protocol Reference documentation, under canEditRowAtIndexPath, "Rows that are not editable ... do no indentation for the deletion or insertion control."

Therefore, the following worked:

-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 1) {   
    return YES;
    } else {
    return NO;
    }

}
Matt Winters