2010-04-09 33 views

回答

1

附件控件是單元格右側的揭示按鈕。刪除控件位於單元格的左側。刪除控制和重新排序控制可以共存。

1

IIRC,你可以做到這一點。我認爲刪除按鈕(從左側滑過)覆蓋在行上,不是附屬視圖。

實現:

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

- (void) tableView:(UITableView *) iTableView commitEditingStyle:(UITableViewCellEditingStyle) iEditingStyle forRowAtIndexPath:(NSIndexPath *) iIndexPath { 
    if (iEditingStyle == UITableViewCellEditingStyleDelete) { 
     //delete row & data 
    } 
} 

這將讓你的滑動刪除。對於重新排序控件,我不確定是否足夠實現tableView:moveRowAtIndexPath:toIndexPath:,您可能還需要將tableview的編輯屬性設置爲YES。

對不起,我不是更具體,它已經有一段時間,因爲我已經做了主要的tableview調整。測試一些東西,看看有什麼作用。 :)

+0

謝謝,要檢查出來。 – dontWatchMyProfile 2010-04-09 10:45:01

相關問題