UITableViewCell ShouldIndentWhenEditing Issues
Im having issues the editing mode of the tableview. When we set the table to edit mode it indents the row cells to the right for edit field on the right. I want to stop this from happening. I have set the cell.shouldIndentWhileEditing = NO; but this doesn't change anything.
Another thing to note is this cell is programmatically built on the fly e.g.
static NSString *CellIdentifier = @"ListingCustomCell";
UITableViewCell *cell = (UITableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 34) reuseIdentifier:CellIdentifier];
}
开发者_Go百科 cell.shouldIndentWhileEditing = NO;
//SETUP CELL FIELDS
//return cell;
Any ideas on what im doing wrong?
Thanks
Perhaps your UITableViewDelegate is returning YES in - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
. If the delegate method is implemented, it'll override the value on the cell.
Did you read this part of the documentation?
This property has an effect only on table views created in the grouped style (
UITableViewStyleGrouped
); it has no effect onUITableViewStylePlain
table views.
Maybe that’s your case.
精彩评论