Git Product home page Git Product logo

Comments (2)

bryankeller avatar bryankeller commented on June 19, 2024

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 ;)

from blkflexibleheightbar.

liuxuan30 avatar liuxuan30 commented on June 19, 2024

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);
    }
}

from blkflexibleheightbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.