UIWindow介绍 发表于 2015-08-14 | 分类于 开发那些事 , iOS | 创建一个Window123456UIWindow *greenWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];greenWindow.windowLevel = UIWindowLevelStatusBar;greenWindow.backgroundColor = [UIColor greenColor];greenWindow.alpha = 0.3;// default hidden=YESgreenWindow.hidden = NO; 这样greenWindow就已经放在屏幕上显示了 隐藏Window12greenWindow.hidden = YES;greenWindow = nil; 给Window添加单击事件12UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:selector(greenWindowTapped:)];[greenWindow addGestureRecognizer:tap];