From 658e19e5f4316e3618dafb07383bfe3db7500fc0 Mon Sep 17 00:00:00 2001 From: Tonny Xu Date: Tue, 19 Aug 2014 08:06:59 +0900 Subject: [PATCH] Removed the dependency of UINavigationBar instance. --- .../UIViewController+NJKFullScreenSupport.m | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m b/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m index 3cf4bfa..d83a6c1 100644 --- a/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m +++ b/NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m @@ -149,15 +149,16 @@ - (void)showTabBar:(BOOL)animated * */ - CGFloat viewHeight = self.navigationController.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]; } - (void)hideTabBar:(BOOL)animated { - CGSize viewSize = self.navigationController.view.frame.size; - CGFloat viewHeight = viewSize.height;//UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? viewSize.height : viewSize.width; + CGSize viewSize = self.tabBarController.view.frame.size; + CGFloat viewHeight = UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? viewSize.height : viewSize.width; [self setTabBarOriginY:viewHeight animated:animated]; } @@ -172,8 +173,8 @@ - (void)setTabBarOriginY:(CGFloat)y animated:(BOOL)animated { CGRect frame = self.tabBarController.tabBar.frame; CGFloat toolBarHeight = frame.size.height; - CGSize viewSize = self.navigationController.view.frame.size; - CGFloat viewHeight = viewSize.height;//UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? viewSize.height : viewSize.width; + CGSize viewSize = self.tabBarController.view.frame.size; + CGFloat viewHeight = UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? viewSize.height : viewSize.width; CGFloat topLimit = viewHeight - toolBarHeight; CGFloat bottomLimit = viewHeight;