From ec38c121a94fa2dce51192eab3b3a750045bb50c Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Fri, 15 May 2015 19:33:23 -0700 Subject: [PATCH] fix jumping navbar title with a more reliable orientation check --- Blog/PostsViewController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Blog/PostsViewController.m b/Blog/PostsViewController.m index b56b52b..042810e 100644 --- a/Blog/PostsViewController.m +++ b/Blog/PostsViewController.m @@ -110,7 +110,8 @@ static const NSUInteger SectionPublished = 1; self.titleViewWidthConstraint.constant = CGRectGetWidth(self.view.bounds); CGFloat height = CGRectGetHeight(self.navigationController.navigationBar.bounds); CGFloat top = 5; - if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)) + // This is more reliable than checking if it's portrait. + if (!UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) { // status bar height += 20;