【问题标题】:Hiding everything in the iOS navbar, including icons隐藏 iOS 导航栏中的所有内容,包括图标
【发布时间】:2019-03-04 17:04:14
【问题描述】:

我已经设法隐藏了导航栏本身,但我希望它全部消失 - 充电图标、连接栏、时钟 - 绝对是一切。

我知道这可能会给我的应用程序造成“死胡同”,但这对我的目的来说是可以的。

我读到here 说这显然是不合法的。这仍然是真的吗?

该应用程序不用于分发,因此即使 Apple 不喜欢它,我仍然有兴趣了解解决方案。

谢谢。

【问题讨论】:

    标签: ios swift iphone ipad


    【解决方案1】:

    我假设你想隐藏status bar

    您可以使用prefersStatusBarHidden 属性在Swift 4.2 中隐藏状态栏:

    class ViewController: UIViewController {
    
         override var prefersStatusBarHidden: Bool {
             return hideStatusBar
         }
    
    
         override func viewDidLoad() {
             super.viewDidLoad()
         }
    }
    

    【讨论】:

    • 你猜对了!自我注意:状态栏,而不是导航栏 ;-) 非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-05
    • 2014-12-21
    • 1970-01-01
    相关资源
    最近更新 更多