开发者

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 on UITableViewStylePlain table views.

Maybe that’s your case.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜