我在另一个上添加了一个新的 UIWIndow 来显示一个视图,但它没有显示任何内容,并且屏幕变得有点模糊。这是代码:
UIWindow* topWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
[topWindow setWindowLevel:UIWindowLevelNormal];
CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
UIViewController* viewController = [[UIViewController alloc] init];
UIView* overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -statusBarHeight, viewController.view.frame.size.width, statusBarHeight - 1)];
[overlay setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
[overlay setBackgroundColor:[UIColor whiteColor]];
[viewController.view addSubview:overlay];
[topWindow setRootViewController:viewController];
[topWindow setHidden:NO];
[topWindow setUserInteractionEnabled:NO];
[topWindow makeKeyAndVisible];
viewController = nil;
overlay = nil;
我究竟做错了什么?