Iphone iOS7 UItableview编辑模式内容重叠

Iphone iOS7 UItableview编辑模式内容重叠,iphone,uitableview,ios7,Iphone,Uitableview,Ios7,当我在iOS 7中进入编辑模式UITableView时,我的单元格内容与删除按钮重叠。 我检查了这个问题,但对我的情况没有帮助 我正在tableView:cellforrowatinexpath方法中动态创建单元格 请让我知道您对这个问题的想法。我实际上使用了这个完整的实现来让一切看起来都很好: - (void)layoutSubviews { [super layoutSubviews]; self.contentView.frame = CGRectMake(0,

当我在iOS 7中进入编辑模式
UITableView
时,我的单元格内容与删除按钮重叠。

我检查了这个问题,但对我的情况没有帮助

我正在
tableView:cellforrowatinexpath
方法中动态创建单元格


请让我知道您对这个问题的想法。

我实际上使用了这个完整的实现来让一切看起来都很好:

- (void)layoutSubviews
{
 [super layoutSubviews];



self.contentView.frame = CGRectMake(0,
                                    self.contentView.frame.origin.y,
                                    self.contentView.frame.size.width,
                                    self.contentView.frame.size.height);



if ((self.editing
    && (_state & UITableViewCellStateShowingDeleteConfirmationMask))){
    float indentPoints = self.indentationLevel * self.indentationWidth;
    self.contentView.frame = CGRectMake(50,
                                        self.contentView.frame.origin.y,
                                        self.contentView.frame.size.width - indentPoints - 30,
                                        self.contentView.frame.size.height);
 }
}
- (void)layoutSubviews
{
[super layoutSubviews];

self.contentView.frame = CGRectMake(0,
                                    self.contentView.frame.origin.y,
                                    self.contentView.frame.size.width,
                                    self.contentView.frame.size.height);

if ((self.editing
    && ((_state & UITableViewCellStateShowingEditControlMask)
        && !(_state & UITableViewCellStateShowingDeleteConfirmationMask))) ||
    ((_state & UITableViewCellStateShowingEditControlMask)
     ))
{
    float indentPoints = self.indentationLevel * self.indentationWidth;
    self.contentView.layer.masksToBounds = YES;
    self.contentView.frame = CGRectMake(50,
                                        self.contentView.frame.origin.y,
                                        self.contentView.frame.size.width - indentPoints,
                                        self.contentView.frame.size.height);
}


if ((self.editing
    && (_state & UITableViewCellStateShowingDeleteConfirmationMask)))
{
    float indentPoints = self.indentationLevel * self.indentationWidth;
    self.contentView.frame = CGRectMake(50,
                                        self.contentView.frame.origin.y,
                                        self.contentView.frame.size.width - indentPoints - 30,
                                        self.contentView.frame.size.height);
}
}

可能是您正在为cellForRowAtIndexPath(委托方法)中的单元格设置单元格setBackgroundImage。不要把这个放在这里。在以下位置设置图像:

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"cellList.png"]]; }
看看: