Skip to content

Commit 7465da2

Browse files
committed
Fix issue m1entus#76
Add the navigationBarHidden judgment
1 parent 7aba182 commit 7465da2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

INSPullToRefresh/INSPullToRefreshBackgroundView.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,13 @@ - (void)handleContentInsetDuringFrameChange {
245245
if (self.shouldResetContentInsetDuringRotation) {
246246
UIViewController *viewController = [self ins_firstResponderViewController];
247247

248+
BOOL navigationBarHidden = viewController.navigationController.navigationBarHidden;
248249
CGFloat navigationBarHeight = viewController.navigationController.navigationBar.frame.origin.y + viewController.navigationController.navigationBar.bounds.size.height;
249-
250+
if (navigationBarHidden) {
251+
navigationBarHeight = 0.f;
252+
}
250253
if (viewController.navigationController.navigationBar.translucent && viewController.parentViewController == viewController.navigationController && self.scrollView.frame.origin.y <= navigationBarHeight) {
251-
self.externalContentInset = UIEdgeInsetsMake(navigationBarHeight - self.scrollView.frame.origin.y, 0, 0, 0);
254+
self.externalContentInset = UIEdgeInsetsMake(navigationBarHeight - self.scrollView.frame.origin.y, self.externalContentInset.left, self.externalContentInset.bottom, self.externalContentInset.right);
252255
}
253256

254257
[self resetFrame];

0 commit comments

Comments
 (0)