iOS.UI.UIWindow
UIWindow
1. UIWindow
2. UIWindow的使用场景
2.1 额外添加的Window需要手动进行旋转
最近有遇到一个UIWindow的使用场景:在ApplicationDelegate.window之外额外创建了一个UIWindow对象(下文称为:otherWin)。
otherWin的windowLevel属性设置为UIWindowLevelAlert。关于windowLevel参考 Ref[2]
现象是:ApplicationDelegate.window可以依据current device orientation进行适当的旋转,而otherWin则不进行旋转。
解决方法如Ref[1]所示。
在iOS 8中针对UIWindow作的改变,参见 Ref[8]。
Reference
1. iPhone - UIWindow rotating depending on current orientation?
2. Using multiple UIWindows in iOS applications
http://shaune.com.au/using-multiple-uiwindows-in-ios-applications/
3. Understanding Windows and Screens
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/WindowAndScreenGuide/WindowScreenRolesinApp/WindowScreenRolesinApp.html
4. UIWindow in iOS (ToRead) (AAAA+)
www.fantageek.com/1317/uiwindow-in-ios/
5. iOS UIScreen and UIWindow
http://isometrick.blogspot.tw/2013/09/ios-uiscreen-and-uiwindow.html
6. UIWindow orientation issues (two UIWindows and landscape mode)
http://fileraid.us/uiwindow-orientation-issues-two-uiwindows-and-landscape-mode/
7. Technical Note TN2244 Launching your iPhone Application in Landscape