diff --git a/GTScrollNavigationBar/GTScrollNavigationBar.m b/GTScrollNavigationBar/GTScrollNavigationBar.m index 3c7fb75..a6fc4bb 100644 --- a/GTScrollNavigationBar/GTScrollNavigationBar.m +++ b/GTScrollNavigationBar/GTScrollNavigationBar.m @@ -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) {