目标是隐藏重新排序动画开始时重新排序的单元格,并在重新排序动画停止时显示单元格。
PS 当你移动单元格时,它的alpha被改变了,我认为有一种方法可以将alpha设置为0,但是如何?我有必要隐藏移动单元的其他阴影,因为我尝试显示不同的图片而不是移动单元。
答案 0 :(得分:0)
[yourtableviewcell setHidden:YES];
如果你想淡化它,首先将alpha动画为0。
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
yourtableviewcell.alpha = 0;
[UIView commitAnimations];
答案 1 :(得分:0)
我在CustomCell类中使用了下一个代码,结果在图片中。细胞是隐藏的,它很好。
- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
NSLog(@"Drugging"); // Dragging started
self.hidden=YES;
} else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {
NSLog(@"Drugging End"); // Dragging ended
self.hidden=NO;
}
}
- (void)layoutSubviews {
[super layoutSubviews];
for (UIView *view in self.subviews) {
if ([NSStringFromClass ([view class]) rangeOfString:@"ReorderControl"].location != NSNotFound) { // UITableViewCellReorderControl
if (view.gestureRecognizers.count == 0) {
UILongPressGestureRecognizer *gesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
gesture.cancelsTouchesInView = NO;
gesture.minimumPressDuration = 0.150;
[view addGestureRecognizer:gesture];
}
}
}
}
答案 2 :(得分:0)