Is it possible to keep the contentView.frame always the same, regardless of tableView.editing? I already tried to override layoutSubviews and willTransitionToState but those options fizzled out too. I can't seem to be able to change the width of the contentView. Or maybe my approach ist just plain impossible ... Maybe there is another way to solve this.
The behaviour I want to achieve is the following: I want the standard textLabel of a UITableViewCell to be always indented and not change position when the tableView enters editing mode. The problem I will probably face is that the behaviour of the detailTextLabel will have to be corrected (e.g. truncation of text if textLabelcontent is too long). The reason why I don't want to implement my own UILabelis because a custom subviews will decrease the scrolling performance by a significant amount.
I hope that anyone already implemented something like this in their UITableViewand could show me a solution to this tedious problem. Thanks in advance!
EDIT: I'm dealing with a UITableView in plain and not grouped style.
Use the UITableViewDelegate method:
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath { return NO; } This will work for both grouped and non-grouped UITableView types. However, if you have a grouped tableview, you can use this property on the cell:
cell.shouldIndentWhileEditing = NO;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With