I want to give some space between UITableView
edit mode delete button and cell left side (See screenshot below).
Any idea?
(source: mixdesign.kz)
UITableView edit mode delete button padding-right
3.1k views Asked by Almas Adilbek At
3
There are 3 answers
0
On
Setting indentationLevel/indentationWidth did not work for me.
What worked for me was subclassing UITableViewCell and customized -layoutSubviews
:
#define LEFT_EDITING_MARGIN 42
- (void)layoutSubviews
{
[super layoutSubviews];
if (self.editing && self.contentView.frame.origin.x != 0) {
CGRect frame = self.contentView.frame;
CGFloat diff = LEFT_EDITING_MARGIN - frame.origin.x;
frame.origin.x = LEFT_EDITING_MARGIN;
frame.size.width -= diff;
self.contentView.frame = frame;
}
}
@property(nonatomic) NSInteger indentationLevel is a property define din UITableViewCell documentation. Using this you can set the indentation level of a tableview Cell. Set this property from your
- (void)willTransitionToState:(UITableViewCellStateMask)state