Skip to content

Commit d3920a0

Browse files
committed
Fixed progress width calculation
Instead of using UIScreen, if possible use the topViewController's view property. This'll work much better if the view is within a UISplitViewController or if it's within a multitasking view on iOS 9.
1 parent 5665de3 commit d3920a0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Classes/NavigationController/UINavigationController+M13ProgressViewBar.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ - (void)updateProgressWithInterfaceOrientation:(UIInterfaceOrientation)interface
163163
}
164164

165165
//Calculate the frame of the navigation bar, based off the orientation.
166-
CGSize screenSize = [UIScreen mainScreen].bounds.size;
166+
UIView *topView = self.topViewController.view;
167+
CGSize screenSize;
168+
if (topView) {
169+
screenSize = topView.bounds.size;
170+
} else {
171+
screenSize = [UIScreen mainScreen].bounds.size;
172+
}
167173
CGFloat width = 0.0;
168174
CGFloat height = 0.0;
169175
//Calculate the width of the screen

0 commit comments

Comments
 (0)