gpt4 book ai didi

uiviewcontroller - 使用 prefersStatusBarHidden 保持 UINavigationBar 高度

转载 作者:行者123 更新时间:2023-12-04 08:30:31 27 4
gpt4 key购买 nike

在我的应用程序中的某些时候,我隐藏了 UIStatusBar在 iOS 7 上。

-(UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
return UIStatusBarAnimationFade;
}

-(BOOL)prefersStatusBarHidden {
if (self.state == StateModal) {
return YES;
}
return NO;
}

然而,这是 View Controller UINavigationBar 的 y 原点。 .由于没有 UIStatusBar,它向上移动可见,但我想保留状态栏的高度,但使其内容不可见。

这可能吗?我不必考虑 iOS 6,只需考虑 iOS 7。

最佳答案

当 Controller 出现时,您可以将当前窗口的 windowLevel 更改为 UIWindowLevelStatusBar
https://stackoverflow.com/a/21158994/2035054

关于uiviewcontroller - 使用 prefersStatusBarHidden 保持 UINavigationBar 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19729586/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com