我有一個自定義的UITableViewCell類,每個單元格都有一個我給它的UIImageView。淡入淡出圖像進入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://stackoverflow.com/questions/10010926/differentiate-between -uitableview編輯態 – priyanka 2012-04-04 12:45:49