0

Aim is to hide cell which is reordering when reordering animation starts and show cell when reordering animation stops.

enter image description here

PS When you moving cell, it's alpha is changed, i think there is a way to set alpha to 0, but how? It is necessary for me to hide else shadow of moving cell, because i try show diferent picture instead moving cell.

4

3 回答 3

0

影子问题有答案

于 2013-08-31T15:40:06.113 回答
0
[yourtableviewcell setHidden:YES];

如果您想将其淡化,请先将 alpha 设置为 0。

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
yourtableviewcell.alpha = 0;
[UIView commitAnimations];
于 2013-08-31T14:18:02.477 回答
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];
            }
        }
    }
}
于 2013-08-31T15:23:56.183 回答