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

Can SquareCashStyleBehaviorDefiner have negative progress #12

Open
rabzu opened this issue Apr 1, 2015 · 2 comments
Open

Can SquareCashStyleBehaviorDefiner have negative progress #12

rabzu opened this issue Apr 1, 2015 · 2 comments

Comments

@rabzu
Copy link

rabzu commented Apr 1, 2015

Is there anyway I can make elements in the navbar animate when SquareCashStyle navbar is expanded downwards?

@bryankeller
Copy link
Owner

This is on my todo list. Once I support auto layout constraints for subviews, then this should be easy to do.

@rabzu I want to elaborate a little on this. If you look at how the square cash app actually behaves, you'll see that as the scroll view stretches beyond the top, the header bar stretches and its content stays pinned at the bottom. This is currently not possible using BLKFlexibleHeightBar because there's no way to say "keep this view pinned to the bottom."

The core problem is that stretching the scroll view beyond the top is

  1. Unbounded (theoretically. but in practice there seems to be a limit to how far it will stretch)
  2. The scroll view is no longer changing its content offset in a linear way. Whatever physics code Apple is using under the hood for scroll view elasticity is completely changing how the content offset is changed.

With all of that said, auto layout is the answer. I could add an extra property that specifically says to pin a view to the bottom when the scroll view is stretched beyond the top, but then I'd be mimicking what auto layout already does ;)

@liuxuan30
Copy link

Currently No. the setter of progress will force it to 0.

- (void)setProgress:(CGFloat)progress
{
    _progress = fmin(progress, 1.0);
    if((self.behaviorDefiner && !self.behaviorDefiner.isElasticMaximumHeightAtTop) || !self.behaviorDefiner)
    {
        _progress = fmax(_progress, 0.0);
    }
}

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

3 participants