0
在IOS应用程序中添加叠加窗口到关键UIWindow。 但是,似乎新的覆盖UIWindow不是任何可见的。UIWindow叠加不可见
似乎正在将它添加成功,虽然,基于LLDB:
(lldb) po UIApplication.shared.windows
▿ 2 elements
- 0 : <UIWindow: 0x7fdfd3d0aec0; frame = (0 0; 375 667); gestureRecognizers = <NSArray: 0x60800004d680>; layer = <UIWindowLayer: 0x608000220980>>
- 1 : <UIWindow: 0x7fdfd3c0d010; frame = (0 0; 375 667); gestureRecognizers = <NSArray: 0x60000004c9c0>; layer = <UIWindowLayer: 0x6000002216e0>>
在调试,
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let vc = UIViewController()
vc.view.backgroundColor = UIColor.blue
let window = UIWindow()
window.frame = self.view.bounds
window.backgroundColor = UIColor.blue
window.windowLevel = UIWindowLevelStatusBar
window.rootViewController = vc
window.isHidden = false
}
希望任何类型的暗示/帮助 感谢
感谢Leo,明确保留窗口解决了问题。希望我能在文档中找到这个要求。 –
是的,Apple的窗口相关主题文档缺乏。请确保在https://bugreport.apple.com打开文档的增强请求 –