在Xcode11中添加launchImage

在Xcode11中,工程 targets里面的App Icons and Launch Images里面没有了Launch Images Source选项,导致选择不了添加的启动页。

可以这样设置:

工程 targets->Build Settings搜索Launch,然后设置创建的启动页名字为LaunchImage,如下图:

然后在Assets.xcassets里面创建LaunchImage,添加各个尺寸的图。如下图:

最后在模拟器中删除APP,重新运行即可。

另外,我们可以在AppDelegate.m中加上[NSThread sleepForTimeInterval:2];

可以修改启动页的停留时间,2的单位为秒。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [NSThread sleepForTimeInterval:2];
    return YES;
}

如果在真机调试时不显示LaunchImage,则需要在LaunchScreen.storyboard上绘制图片。

原文地址:https://www.cnblogs.com/luoyihao/p/12829056.html