LaunchScreen.storyboard设置启动页

设置【General】->【App Icons and Launch Images】

注意:当App不是用LaunchScreen.xib来配置启动页时,【LaunchScreen File】置空。

如果没有【LaunchImage】,则进行创建:

Assets.xcassets右键->【App Icons & Launch Images】->【New iOS Launch Image】

设置【Assets.scassets】->【LaunchImage】,并进行勾选【属性检查器】中的【Portrait】

注意:图片需要是png格式。

设置【LaunchScreen.storyboard】,取消勾选【Use as Launch Screen】

在【AppDeleaget.swift】设置启动页的时长:

1 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
2         // Override point for customization after application launch.
3         //在顶部状态栏显示风火轮
4         UIApplication.shared.isNetworkActivityIndicatorVisible = true
5         //启动页显示时间3s
6         Thread.sleep(forTimeInterval: 3)
7         UIApplication.shared.isNetworkActivityIndicatorVisible = false
8         return true
9     }

点击查看:【LaunchScreen.storyboard如何跳转到到Main.storyboard】

猜你喜欢

转载自www.cnblogs.com/strengthen/p/10636993.html
今日推荐