[英]How to prevent status bar disappearing before UIImagePickerController covers the whole screen?
如果希望狀態欄停留在屏幕頂部,則應創建一個自定義窗口並手動應用動畫。 這可能會有所幫助:
var newWindow = UIWindow()
let newController = viewControllerToPresent()
var animationDuration = 0.4 // or whatever you want.
// setting newController as root of new window.
self.window.rootViewController = newController
self.window.windowLevel = UIWindowLevelStatusBar
self.window.backgroundColor = .clear
self.window.frame = CGRect(x: 0, y: UIScreen.main.bounds.height, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
self.window.isHidden = false
UIView.animate(withDuration: animationDuration) {
self.window.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.