fix jumping navbar title with a more reliable orientation check

This commit is contained in:
Sami Samhuri 2015-05-15 19:33:23 -07:00
parent 19d0349bb2
commit ec38c121a9

View file

@ -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;