UIWindow的显示问题

2018-07-24  本文已影响0人  就是这调调c

今天创建UIWindow的时候,显示不出来。要把window变成实例变量或者属性变量才能显示出来。

{

    UIWindow*window;

}

  window = [[UIWindow alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];

    window.rootViewController = [[UIViewController alloc]init];

    window.windowLevel = UIWindowLevelAlert;

    window.rootViewController.view.backgroundColor = [UIColor yellowColor];

    [window makeKeyAndVisible];

上一篇 下一篇

猜你喜欢

热点阅读