2013-08-31 32 views
0

目标是隐藏当重新排序动画开始时重新排序的单元格,并在重新排序动画停止时显示单元格。如何隐藏单元格重新排序TableVirew

enter image description here

PS 当你移动电池,它的阿尔法改变,我觉得有一种方法来设置阿尔法为0,但如何?我需要隐藏移动单元格的其他阴影,因为我尝试显示不同的图片,而不是移动单元格。

+0

你需要这方面的问题,更多的帮助?如果答案帮助您解决了问题,请记住接受它。回答你自己的问题是可以的,但你不应该折合多个答案。您可以编辑答案以添加更多相关信息。看看http://stackoverflow.com/about,如果你想了解更多关于stackoverflow的基础知识。 –

回答

0
[yourtableviewcell setHidden:YES]; 

如果要淡入淡出,首先将alpha设置为0。

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:0.5]; 
yourtableviewcell.alpha = 0; 
[UIView commitAnimations]; 
+0

我应该用什么方法[yourtableviewcell setHidden:YES] – mriddi

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]; 
      } 
     } 
    } 
} 
相关问题