Skip to content

Commit

Permalink
处理 iOS 18 导航栏兼容性问题
Browse files Browse the repository at this point in the history
  • Loading branch information
listenzz committed Oct 18, 2024
1 parent 417b9dc commit ed283d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ios/HybridNavigation/ViewController/HBDNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,12 @@ - (void)clearFake {
}

- (CGRect)fakeBarFrameForViewController:(UIViewController *)vc {
CGRect frame = CGRectMake(0, 0, self.navigationBar.frame.size.width, UIApplication.sharedApplication.statusBarFrame.size.height + self.navigationBar.frame.size.height);
return frame;
CGFloat height = self.navigationBar.frame.size.height + self.navigationBar.frame.origin.y;
if (vc.view.frame.size.height == self.view.frame.size.height) {
return CGRectMake(0, 0, self.navigationBar.frame.size.width, height);
}else{
return CGRectMake(0, -height, self.navigationBar.frame.size.width, height);
}
}

- (CGRect)fakeShadowFrameWithBarFrame:(CGRect)frame {
Expand Down

0 comments on commit ed283d4

Please sign in to comment.