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

FacebookStyleBarBehaviorDefiner with pagination #60

Open
cojoj opened this issue Aug 12, 2016 · 0 comments
Open

FacebookStyleBarBehaviorDefiner with pagination #60

cojoj opened this issue Aug 12, 2016 · 0 comments

Comments

@cojoj
Copy link

cojoj commented Aug 12, 2016

So we have UITableView which is used in our app and FacebookStyleBarBehaviorDefiner perfectly matches our requirements, but we have one issue...
Our UITableView is aable to load more stuff - pagination. While we load new page contentOffset changes and BLKFlexibleHeightBar is presented out of nothing, which creates this weird behavior.

Looks like this code is responsible for what's happening:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if(!self.isCurrentlySnapping)
    {
        CGFloat deltaYOffset = scrollView.contentOffset.y - self.previousYOffset;
        CGFloat deltaProgress = deltaYOffset / (self.flexibleHeightBar.maximumBarHeight-self.flexibleHeightBar.minimumBarHeight);

        self.flexibleHeightBar.progress = self.previousProgress + deltaProgress;

        [self.flexibleHeightBar setNeedsLayout];
    }
}

So when I log what values do I have there I've noticed that at some point deltaYOffset is negative when it shouldn't while I'm scrolling to the bottom. I've changed this, so I always get positive number there, but then I wasn't able to scroll to the top to see the bar again.

Any ideas how to solve this?

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

1 participant