NJHu / iOSProject

iOS project of collected some demos for iOS App, use Objective-C

Home Page:https://github.com/NJHu/iOSProject

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

列表拖拽

storm-CC opened this issue · comments

列表拖拽->长按cell->可以拖动的时候立马end->cell消失了
ps:UIGestureRecognizerStateBegan和UIGestureRecognizerStateEnded里面都用了animateWithDuration,�这种情况下,虽然在UIGestureRecognizerStateEnded里面beginCell.hidden = NO;,但是最后执行的是“onCell.hidden = YES;”,所以cell还是隐藏掉了

commented
  • 根据您的描述和相应操作, 的确存在相应的问题和 bug,
  • 已修改, 谢谢您.
  • 修改如下, 在 statechange 的时候 让其 onCell.hidden = yes
        if (recognizer.state == UIGestureRecognizerStateChanged) {
            if (!weakself.lastChangeIndexPath) {
                return;
            }
            UICollectionViewCell *lastChangeIndexPathCell = [weakself.collectionView cellForItemAtIndexPath:weakself.lastChangeIndexPath];
            if (!lastChangeIndexPathCell) {
                return;
            }
            // 在这里控制隐藏
            lastChangeIndexPathCell.hidden = YES;
.........
  • 另修改了其他 bug:
    • 手势停止的时候让 onCell 处于视图最上层做动画, 要不然会被遮住
    • 拖拽的时候,让 drawImageView 处于视图最上层