diff --git a/Classes/NavigationController/UINavigationController+M13ProgressViewBar.m b/Classes/NavigationController/UINavigationController+M13ProgressViewBar.m index ba0e7fd..6324893 100644 --- a/Classes/NavigationController/UINavigationController+M13ProgressViewBar.m +++ b/Classes/NavigationController/UINavigationController+M13ProgressViewBar.m @@ -209,31 +209,10 @@ - (void)updateProgressWithInterfaceOrientation:(UIInterfaceOrientation)interface } else { backgroundView.backgroundColor = [UIColor clearColor]; } - - //Calculate the frame of the navigation bar, based off the orientation. - UIView *topView = self.topViewController.view; - CGSize screenSize; - if (topView) { - screenSize = topView.bounds.size; - } else { - screenSize = [UIScreen mainScreen].bounds.size; - } - CGFloat width = 0.0; - CGFloat height = 0.0; - //Calculate the width of the screen - if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) { - //Use the maximum value - width = MAX(screenSize.width, screenSize.height); - if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { - height = 32.0; //Hate hardcoding values, but autolayout doesn't work, and cant retreive the new height until after the animation completes. - } else { - height = 44.0; //Hate hardcoding values, but autolayout doesn't work, and cant retreive the new height until after the animation completes. - } - } else { - //Use the minimum value - width = MIN(screenSize.width, screenSize.height); - height = 44.0; //Hate hardcoding values, but autolayout doesn't work, and cant retreive the new height until after the animation completes. - } + + //Change the progress and background view frames to match the navigationBar + CGFloat width = self.navigationBar.frame.size.width; + CGFloat height = self.navigationBar.frame.size.height; //Check if the progress view is in its superview and if we are showing the bar. if (progressView.superview == nil && [self isShowingProgressBar]) {