2012-04-04 69 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