在我的应用程序中,我想UIWindow
在主 UIWindow 上创建一个新的,我写如下,但它不起作用。首先,我创建一个UIWindow
作为主窗口,然后使其成为键和可见,然后创建一个新的UIWindow
覆盖,但没有任何反应。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor redColor];
ViewController *vc = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = vc;
[self.window makeKeyAndVisible];
UIWindow *window1 = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
window1.backgroundColor = [UIColor redColor];
window1.windowLevel = UIWindowLevelAlert;
[window1 makeKeyAndVisible];
return YES;
}