0

セルへの参照を非常に簡単に取得できます

cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];

ただし、編集/並べ替えモードでは、セルの右側にある小さなハンドルへの参照を取得する必要があります。これどうやってするの?

4

2 に答える 2

1

このコードで見つけることができますが、reorder-controlはprivate-apiです

for (UIView *view in cell.subviews) {
    if ([NSStringFromClass([view class]) isEqualToString:@"UITableViewCellReorderControl"]) {
        // 'view' is the reorder control
    }
}
于 2013-01-15T13:30:08.643 に答える
0

editingAccessoryViewセルのプロパティを使用する必要があります:

cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
UIView *editingAccessory = cell.editingAccessoryView;
于 2013-01-15T14:37:36.347 に答える