2009-09-17 50 views
12

我期待允許UITableViewCell小號重新排序,並通過刷卡刪除刪除,但不是通過紅色刪除社交圈。啓用刷卡到刪除,同時展示訂貨控制上的UITableView

- (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]沒有運氣。

Image http://booleanmagic.com/uploads/ReorderNotDelete.png

+0

是的,我知道的屬性。 「鏈接帳戶」功能無效。阻力最小的路徑是創建一個新賬戶並孤立臨時賬戶。 – rpetrich 2012-09-04 01:18:04

回答

2

我認爲你必須做一些定製的觸摸事件攔截。

英文: 如果手指移動時,距離x的,水平橫跨細胞,在該細胞只,然後顯示刪除控件。

不知道如何圓關閉到左側,但我認爲它像「顯示重新排序控制」

+0

不幸的是,似乎沒有辦法以編程方式顯示刪除確認(showsDeleteConfirmation是隻讀的)。現在我要離開重新訂購控制,但可能最終會攔截觸摸並手動顯示自定義刪除按鈕。 – rpetrich 2009-10-26 15:43:13

相關問題