在我的应用中,我需要使整个应用的整个屏幕变暗。我正在使用重叠窗口UIWindow *alphaWindow
属性来做到这一点,
self.alphaWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.alphaWindow.backgroundColor = [UIColor blackColor];
self.alphaWindow.windowLevel = UIWindowLevelAlert+1;
self.alphaWindow.hidden = NO;
self.alphaWindow.userInteractionEnabled = NO;
self.alphaWindow.rootViewController = [UIViewController new];
self.alphaWindow.alpha = 0.5;
除了在两种特殊情况下之外,这还算不错:
QLPreviewController
中的内部(导航栏下方的所有内容)在显示图片以外的任何内容时都不会受到触摸(奇怪的是,图片运行良好)。UIImagePickerController
也是如此;在导航栏下方没有收到触摸。我的问题是: