Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

闪电购物左边分类 点击 出现 cell 跳跃的现象 #2

Open
Beyond-Chao opened this issue Jul 8, 2016 · 1 comment
Open

Comments

@Beyond-Chao
Copy link

Beyond-Chao commented Jul 8, 2016

if delegate != nil && delegate!.respondsToSelector("didEndDisplayingHeaderView:") && isScrollDown {
delegate!.didEndDisplayingHeaderView!(section)
}

if delegate != nil && delegate!.respondsToSelector("willDisplayHeaderView:") && !isScrollDown {
delegate!.willDisplayHeaderView!(section)
}

个人觉得再&&一个 productsTableView.dragging 的判断。虽然这样可以解决, cell跳跃的现象,但是点击cell的动画就没了。

不知作者有何高见。既能保留动画,有不会出现跳跃的方法。谢谢!

@XYXiaoYuan
Copy link

加一个判断就好了
#pragma mark - tabelView delegate

  • (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section {
    if (self.tableView.isDragging) {
    if (!self.isScrollDown && [self.delegate respondsToSelector:@selector(willDisplayHeaderView:)]) {
    [self.delegate willDisplayHeaderView:section];
    }
    }
    }
  • (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)section {
    if (self.tableView.isDragging) {
    if (self.isScrollDown && [self.delegate respondsToSelector:@selector(didEndDisplayHeaderView:)]) {
    [self.delegate didEndDisplayHeaderView:section];
    }
    }
    }

因为联动的原因,点击右边会影响左边,所以点击右边的时候,加个判断就好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants