Skip to content

Commit

Permalink
Removed the dependency of UINavigationBar instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
TonnyXu committed Aug 18, 2014
1 parent 03308a1 commit 658e19e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand All @@ -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;
Expand Down

0 comments on commit 658e19e

Please sign in to comment.