主要用途:
1、用作蒙版
2、用作手势View
UIWindow的创建和UIView不同,UIWindow一旦被创建他就会添加到整个界面上,但是默认是hidden的,创建时注意要把UIWindow设置成全局变量;谁的UIWindow的UIWindowLevel值越大,谁的UIWindow就在最上面;UIWindowLevel优先级相等的情况下,看谁后实例化了,谁后实例化谁先显示。
当前窗口只能有一个主窗口
@property(nonatomic) UIWindowLevel windowLevel; // default = 0.0
@property(nonatomic,readonly,getter=isKeyWindow) BOOL keyWindow;
- (void)becomeKeyWindow; // override point for subclass. Do not call directly
- (void)resignKeyWindow; // override point for subclass. Do not call directly
- (void)makeKeyWindow;
- (void)makeKeyAndVisible; // convenience. most apps call this to show the main window and also make it key. otherwise use view hidden property
资料:
http://blog.youkuaiyun.com/hello_hwc/article/details/50670079
http://blog.youkuaiyun.com/liangliang103377/article/details/45060209