2012-04-04 73 views

回答

0

寫下面你custome細胞類方法

- (void)setEditing:(BOOL)editing animated:(BOOL)animated{ 
    [super setEditing:editing animated:animated]; 
    if (editing) { 
    PUT YOUR fade animation code here 
    } 

}

+0

這是工作,以及謝謝,但在那裏一種方法來區分按下編輯按鈕和滑動刪除?因爲我只需要在點擊編輯按鈕時執行此操作,滑動不會導致問題。 – 2012-04-04 11:59:35

+0

http://stackoverflow.com/questions/10010926/differentiate-between -uitableview編輯態 – priyanka 2012-04-04 12:45:49

1
- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath { 
//detect editing mode 
    for (UITableViewCell *cell in self.tableView.visibleRows) { // loop through the visible cells and animate their imageViews 

     [UIView animateWithDuration:1.0 
       delay:0 
       animations: ^{ cell.imageView.alpha = 0.5; } 
       completion: ^(BOOL finished) { cell.imageView.alpha = 1.0; } 
     }]; 
    } 

} 
+0

是UITableView的或UITableViewCell中的這種方法的一部分?我無法在任何地方找到任何信息。 – 2012-04-04 11:43:26

+0

以前的方法我實際上已經完成了,這個方法(完整的形式應該在UITableViewDelegate中有記錄) – 2012-04-04 11:44:31

+0

對不起,你已經失去了我,你只引用了'didEnterEditingMode',我假定你編制了它?這是記錄? – 2012-04-04 11:47:22