1

並べ替えられないテーブルビューがあります。moveRowAtIndexPath は、destinationIndexPath とは異なる sourceIndexPath で呼び出されることはないようです。列を引っ張ると、列が動きをサポートしていないかのように、開始位置に跳ね返ります。

すべての「canMove/canEdit/propose」メソッドを実装して YES を返そうとしましたが、同じ動作を観察しました。どうしたの?

- (void) tableView:(UITableView *)tableView
moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath
       toIndexPath:(NSIndexPath *)destinationIndexPath {

    NSLog(@"%d -> %d", [sourceIndexPath row], [destinationIndexPath row]);
    if ([sourceIndexPath row] == [destinationIndexPath row]) {
        return;
    }

    MyDomain *domain = [self getObject];
    [domain.stuff exchangeObjectAtIndex:(NSUInteger) [sourceIndexPath row] withObjectAtIndex:(NSUInteger) [destinationIndexPath row]];
}
4

1 に答える 1

2

ビューでのパンをキャンセルする IIViewDeckController を使用しています。

ViewDeckController を設定するときは、次のようにします。 self.panningCancelsTouchesInView = NO;

于 2013-05-18T22:31:52.573 に答える