Swift 3.0 - how to hide status bar after calling UIImagePickerController?

后端 未结 4 1978
太阳男子
太阳男子 2020-12-21 04:57

Happy New Year!

I want to hide status bar after calling UIImagePickerController on iOS 10.2. You know there are already several questions about it with some answers,

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-21 05:52

    The status bar can be hidden and show when presenting view controller UIImagePickerController swift 4+

    picker.dismiss(animated: true, completion: {
        if let statusBar = UIApplication.shared.value(forKey: "statusBar") as? UIView {
            statusBar.isHidden =  true
        }
    })
    
    picker.dismiss(animated: true, completion: {
        if let statusBar = UIApplication.shared.value(forKey: "statusBar") as? UIView {
            statusBar.isHidden =  false
        }
    })
    

提交回复
热议问题