13

UITableViewCellsの並べ替えとスワイプによる削除を許可したいのですが、赤い削除サークルでは許可していません。

- (void)loadView
{
    [super loadView];
    [table setEditing:YES animated:NO];
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Perform delete here
    }
}

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
    // Perform move here
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellEditingStyleDelete;
}

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    return YES;
}

さらに、編集モードを無効にし-[UITableViewCell setShowsReorderControl:YES]て、運が悪かったので電話をかけてみました。

画像
(出典:booleanmagic.com

4

1 に答える 1

2

カスタムタッチイベントのインターセプトを行う必要があると思います。

英語:指を動かした場合、x距離、セルを横切って水平に、そのセルのみで、削除コントロールを表示します。

左側の円をオフにする方法はわかりませんが、「並べ替え制御を表示する」のようなプロパティだと思います

于 2009-10-21T21:57:33.137 に答える