UITableViewCellをサブクラス化し、編集不可能な行を自分でスライドします。
@interface MyHistoryTableViewCell : UITableViewCell
@end
@implementation MyHistoryTableViewCell : UITableViewCell
#define CELL_SLIDE_WIDTH 32 // found empirically
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing:editing animated:animated];
if (self.editingStyle == UITableViewCellEditingStyleNone) { // not editable
CGRect frame = self.frame;
UITableView *tableView = ((UITableView *)(self.superview));
if (tableView.editing) { // going to editing mode
frame.origin.x = CELL_SLIDE_WIDTH;
frame.size.width = tableView.frame.size.width - CELL_SLIDE_WIDTH;
} else { // ending editing
frame.origin.x = 0;
frame.size.width = tableView.frame.size.width;
}
[UIView animateWithDuration:0.3 animations:^{ // match the tableView slide duration
self.frame = frame;
}];
}
}
@end
あなたが(例えば、スライドさせてはならないボタン)セルの右側に固定する必要がサブビューを持っている場合は、また
mySubview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; // anchors to the right margin
行う、あなたは時に創造的でなければなりませんサブビューのframe.origin.xを設定します。私は働いていたものが見つかるまで多くの価値を試しました(価値は私には意味がありません)。
カスタムセルを使用していますか、または組み込みセルをカスタマイズしていますか? – dasblinkenlight