美文网首页
2018-11-22

2018-11-22

作者: 惊蛰_e3ce | 来源:发表于2018-11-22 21:32 被阅读0次

    mjrefresh之后reloadtableview 此时如有masonry 控件紧贴cell 会有跳跃效果???最好改成frame UIviewanimation和masonry和setneedlayout慎用
    当一个全部组合用 另一个只masonry时 产生跳跃效果
    例子:1:updateLable会正常动画 但是operationView(基于frame)的动画效果会受 reloaddata和layoutneed的先后顺序影响 如果先reloaddata 在layoutneed则会产生跳跃效果

    先layoutneed在reloaddata效果正常

    2:如果operationView改成masonry则动画效果一直跳跃 待研究(layoutneed导致masonry立即布局完成 缺少过渡效果 总是比cell先到达指定位置)

    [UIView animateWithDuration:0.3 animations:^{
    [self.updateLable mas_updateConstraints:^(MASConstraintMaker *make) {
    make.height.mas_equalTo(updateRect.size.height + 8);
    }];
    [self.view layoutIfNeeded];
    }];

    _adaptManager.tableViewDidScroll = ^(UIScrollView *scrollView) {
    STRONGSELF
    CGRect rect = [strongSelf.filterCell convertRect:strongSelf.filterCell.bounds toView:strongSelf.view];
    if (rect.origin.y <= 0) {
    strongSelf.operationView.frame = CGRectMake(0, 0, WIDTHOFSCREEN, 30);
    }else{
    strongSelf.operationView.frame = CGRectMake(0, rect.origin.y, WIDTHOFSCREEN, 30);
    }
    };
    }

    • (void)layoutoperationView:(NSNotification *)notification
      {
      if (!_filterCell) {
      _filterCell = notification.userInfo[@"cell"];
      [self.view addSubview:self.operationView];
      self.operationView.frame = CGRectMake(0, section0Height, WIDTHOFSCREEN, 30);
      }
      }

    相关文章

      网友评论

          本文标题:2018-11-22

          本文链接:https://www.haomeiwen.com/subject/vdmrqqtx.html