iOS18Bate导航栏

代码如下

  • (void)viewDidLoad {

    [super viewDidLoad];

    self.navigationController.navigationBar.translucent = NO;

}

  • (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:true];

}

此时加载VC时顶部会出现空白,整个VC的frame的Y值向下偏移了状态栏的高度,再次切换到此VC则会恢复,这是iOS18Bate的bug吗

??

We also had this problem, and we solved it temporarily by putting setNavigationBarHidden in viewDidLoad. I think this is most likely an iOS 18 bug

iOS18Bate导航栏
 
 
Q