Skip to content

Commit

Permalink
Merge pull request #20 from TonnyXu/master
Browse files Browse the repository at this point in the history
Fixed a problem when using `-showTabBar:` in iPad started in landscape mode
  • Loading branch information
ninjinkun committed Aug 19, 2014
2 parents 6bd4683 + a269667 commit bffbb97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NJKScrollFullScreen/UIViewController+NJKFullScreenSupport.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand All @@ -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;

Expand Down

0 comments on commit bffbb97

Please sign in to comment.