diff --git a/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m b/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m index b685320..63fafe4 100644 --- a/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m +++ b/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m @@ -138,7 +138,8 @@ - (void)setToolbarOriginY:(CGFloat)y animated:(BOOL)animated - (void)showTabBar:(BOOL)animated { - CGFloat viewHeight = self.tabBarController.view.frame.size.height; + CGSize viewSize = self.tabBarController.view.frame.size; + CGFloat viewHeight = UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? viewSize.height : viewSize.width; CGFloat toolbarHeight = self.tabBarController.tabBar.frame.size.height; [self setTabBarOriginY:viewHeight - toolbarHeight animated:animated]; } @@ -163,7 +164,6 @@ - (void)setTabBarOriginY:(CGFloat)y animated:(BOOL)animated CGFloat toolBarHeight = frame.size.height; CGSize viewSize = self.tabBarController.view.frame.size; CGFloat viewHeight = UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? viewSize.height : viewSize.width; - CGFloat topLimit = viewHeight - toolBarHeight; CGFloat bottomLimit = viewHeight;