diff --git a/GTScrollNavigationBar/GTScrollNavigationBar.h b/GTScrollNavigationBar/GTScrollNavigationBar.h index 02d60f4..ae42b97 100644 --- a/GTScrollNavigationBar/GTScrollNavigationBar.h +++ b/GTScrollNavigationBar/GTScrollNavigationBar.h @@ -18,6 +18,7 @@ typedef NS_ENUM(NSInteger, GTScrollNavigationBarState) { @property (strong, nonatomic) UIScrollView *scrollView; @property (assign, nonatomic) GTScrollNavigationBarState scrollState; +@property (assign, nonatomic) BOOL adjustsScrollView; - (void)resetToDefaultPositionWithAnimation:(BOOL)animated; diff --git a/GTScrollNavigationBar/GTScrollNavigationBar.m b/GTScrollNavigationBar/GTScrollNavigationBar.m index c11f259..b017c86 100644 --- a/GTScrollNavigationBar/GTScrollNavigationBar.m +++ b/GTScrollNavigationBar/GTScrollNavigationBar.m @@ -42,6 +42,7 @@ - (void)setup action:@selector(handlePan:)]; self.panGesture.delegate = self; self.panGesture.cancelsTouchesInView = NO; + self.adjustsScrollView = YES; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive) @@ -216,7 +217,7 @@ - (void)setFrame:(CGRect)frame alpha:(CGFloat)alpha animated:(BOOL)animated self.frame = frame; - if (self.scrollView) { + if (self.scrollView && self.adjustsScrollView) { CGRect parentViewFrame = self.scrollView.superview.frame; parentViewFrame.origin.y += offsetY; parentViewFrame.size.height -= offsetY;