0
テーブル編集モードを使用しているときに、表のセルの内容が左側にシフトしないようにします。で提案されているようにUITableViewのshouldIndentWhileEditingRowAtIndexPath:が呼び出されていません
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
return NO;
}
:私は私のビューコントローラで、次のUITableViewDelegate
メソッドを実装し
Prevent indentation of UITableViewCell (contentView) while editing
しかし、今までと呼ばれていないようです。これはどちらか動作しませんでした:私は、テーブルビューのdelegate
性質があることをダブルチェック
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView
editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
NSMutableArray<UITableViewRowAction *> *actions = [NSMutableArray array];
id clearHandler = ^(UITableViewRowAction *action, NSIndexPath *indexPath) {
...
};
UITableViewRowAction *clearAction = [UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleDestructive
title:@"Clear\nStatus"
handler:clearHandler];
[actions addObject:clearAction];
id editHandler = ^(UITableViewRowAction *action, NSIndexPath *indexPath) {
...
};
UITableViewRowAction *editAction = [UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleNormal
title:@"Edit"
handler:editHandler];
[actions addObject:editAction];
return actions;
}
:私はこのように定義されたカスタムエディット行アクションのカップルを使用してい
cell.shouldIndentWhileEditing = NO;
をビューコントローラをポイントします。ほかに何が足りないのですか?
テーブルビュースタイルはグループ化されていません。つまり、プレーンです。
グループ化されたテーブルビューを使用していますか? 'UITableView.h':"このメソッドはグループ化されたスタイルテーブルビューにのみ適用されます。 " – norders
あなたはあなたの問題を解決したかしなかったのですか? –
@nordersテーブルスタイルは平易です。だから、プレーンなテーブルビューではこれを達成することはできませんか? – iosdude