maxep / MXSegmentedPager

Segmented pager view with Parallax header
MIT License
1.27k stars 252 forks source link

Disable the parallax effect while scrolling up #211

Closed Evyasafmordechai closed 5 years ago

Evyasafmordechai commented 6 years ago

I would like to disable the parallax effect while scrolling up. I set segmentedPager.bounces = false to disable parallax when scrolling down but I don't know how to disable when scrolling up.

How can I do it?

Thank you for any help

Evyasafmordechai commented 6 years ago

I managed to do it by changing the method: layoutContentView inside MXParallaxHeader.m the result:

- (void)layoutContentView {
    CGRect frame = (CGRect){
        .origin.x       = 0,
        .origin.y       = -self.height,
        .size.width     = self.scrollView.frame.size.width,
        .size.height    = self.height
    };
    self.contentView.frame = frame;
    CGFloat div = self.height - self.minimumHeight;
    self.progress = (self.contentView.frame.size.height - self.minimumHeight) / (div? : self.height);
}
knowsudhanshu commented 6 years ago

Any update on this feature?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.