Skip to content

Commit

Permalink
fix iOS 18 修复导航栏背景向下偏移问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yg authored and listenzz committed Oct 18, 2024
1 parent a378ffd commit efaa369
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions HBDNavigationBar/Classes/HBDNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,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 efaa369

Please sign in to comment.