淡入淡出图像进入UITableView编辑模式?
我有一个自定义的UITableViewCell类,每个单元格都有一个我给它的UIImageView。淡入淡出图像进入UITableView编辑模式?
我想要做的就是在进入编辑模式时淡出此图像,并在退出编辑模式时淡入此图像。
希望你能帮忙,谢谢。
写下面你custome细胞类方法
- (void)setEditing:(BOOL)editing animated:(BOOL)animated{
[super setEditing:editing animated:animated];
if (editing) {
PUT YOUR fade animation code here
}
}
- (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; }
}];
}
}
是UITableView的或UITableViewCell中的这种方法的一部分?我无法在任何地方找到任何信息。 – 2012-04-04 11:43:26
以前的方法我实际上已经完成了,这个方法(完整的形式应该在UITableViewDelegate中有记录) – 2012-04-04 11:44:31
对不起,你已经失去了我,你只引用了'didEnterEditingMode',我假定你编制了它?这是记录? – 2012-04-04 11:47:22
这是工作,以及谢谢,但在那里一种方法来区分按下编辑按钮和滑动删除?因为我只需要在点击编辑按钮时执行此操作,滑动不会导致问题。 – 2012-04-04 11:59:35
http://*.com/questions/10010926/differentiate-between -uitableview编辑态 – priyanka 2012-04-04 12:45:49