I really use this full implementation to make everything look good:
- (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);
}
}
source
share