gpt4 book ai didi

swift - 使用 View Swift 部分覆盖 UIStatusBar

转载 作者:行者123 更新时间:2023-11-28 08:30:31 25 4
gpt4 key购买 nike

我想让我的侧边栏菜单 View 打开到全屏高度,这样它甚至可以覆盖状态栏,但让状态栏的右侧可见。现在它在状态栏下打开,即使我已将 View 框架设置为

let statusBarHeight = UIApplication.sharedApplication().statusBarFrame.size.height
let screenSize: CGRect = UIScreen.mainScreen().bounds
let screenHeight = screenSize.height
sidebarContainerView.frame = CGRectMake(-barWidth - 1, screenSize.origin.y + 10, barWidth, screenHeight + statusBarHeight)

我的 View 是窗口的直接 subview 。

最佳答案

View 不能放在状态栏前面。任何超出状态栏底部的 View 都将被它覆盖。此外,它完全违反了 Apple 的 iOS 人机界面指南,如所述 here .另外,您说要隐藏状态栏。只有在显示媒体时才应该这样做。不要永久隐藏它,因为这也违反了准则。

关于swift - 使用 View Swift 部分覆盖 UIStatusBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38963514/

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