Skip to content

Commit

Permalink
修复 qmui_tabBarSpacingInViewCoordinator 和 qmui_navigationBarMaxYInView…
Browse files Browse the repository at this point in the history
…Coordinator 由于UIView convertRect:fromView: 在 iOS 8 下可能转换错误导致crash
  • Loading branch information
zhoon committed Nov 4, 2017
1 parent 12bad59 commit 41f77b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions QMUIKit/UIKitExtensions/UIViewController+QMUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ - (CGFloat)qmui_navigationBarMaxYInViewCoordinator {
if (!self.navigationController.navigationBar || self.navigationController.navigationBarHidden) {
return 0;
}
CGRect navigationBarFrame = CGRectIntersection(self.view.bounds, [self.view convertRect:self.navigationController.navigationBar.frame fromView:self.navigationController.navigationBar.superview]);
CGRect navigationBarFrame = CGRectIntersection(self.view.bounds, [self.view convertRect:self.navigationController.navigationBar.frame fromView:nil]);
CGFloat result = CGRectGetMaxY(navigationBarFrame);
return result;
}
Expand All @@ -243,7 +243,7 @@ - (CGFloat)qmui_tabBarSpacingInViewCoordinator {
if (!self.tabBarController.tabBar || self.tabBarController.tabBar.hidden) {
return 0;
}
CGRect tabBarFrame = CGRectIntersection(self.view.bounds, [self.view convertRect:self.tabBarController.tabBar.frame fromView:self.tabBarController.tabBar.superview]);
CGRect tabBarFrame = CGRectIntersection(self.view.bounds, [self.view convertRect:self.tabBarController.tabBar.frame fromView:nil]);
CGFloat result = CGRectGetHeight(self.view.bounds) - CGRectGetMinY(tabBarFrame);
return result;
}
Expand Down

0 comments on commit 41f77b3

Please sign in to comment.