美文网首页
移除main.storyboard

移除main.storyboard

作者: 醉了俗身醒了初心 | 来源:发表于2023-12-12 19:58 被阅读0次

    解决方法如下:

    image.png image.png image.png
    @property(nonatomic, strong) UIWindow *window;
    
    image.png
    - (void) createAppWindow {
        if(@available(iOS 13.0, *)) {
            
        } else {
            self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
            self.window.rootViewController = [[ViewController alloc] init];
            self.window.backgroundColor = [UIColor whiteColor];
            [self.window makeKeyAndVisible];
        }
    }
    
    image.png
    if(scene) {
            UIWindowScene *windowScene = (UIWindowScene*)scene;
            self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
            self.window.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
            self.window.rootViewController = [[ViewController alloc] init];
            self.window.backgroundColor = [UIColor whiteColor];
            [self.window makeKeyAndVisible];
        }
    

    相关文章

      网友评论

          本文标题:移除main.storyboard

          本文链接:https://www.haomeiwen.com/subject/lnovgdtx.html