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

During the frame animation make sure the content offset is also animated #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
During the frame animation make sure the content offset is also animated
This imposes a significant problem if the scrollview has floating items on top that have to be repositioned everytime the content is scrolled.
  • Loading branch information
Fabian Bumberger committed Nov 30, 2015
commit 4566b2c4c7930d713042760babea3b40573dd134
3 changes: 3 additions & 0 deletions GTScrollNavigationBar/GTScrollNavigationBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ - (void)setFrame:(CGRect)frame alpha:(CGFloat)alpha animated:(BOOL)animated
parentViewFrame.origin.y += offsetY;
parentViewFrame.size.height -= offsetY;
self.scrollView.superview.frame = parentViewFrame;
if (animated) {
self.scrollView.contentOffset = CGPointMake(self.scrollView.contentOffset.x, self.scrollView.contentOffset.y - offsetY);
}
}

if (animated) {
Expand Down