简体   繁体   English

Xcode6 Swift添加启动屏幕

[英]Xcode6 Swift add Launchscreen

How can I add a launch screen after the app is finished? 应用完成后如何添加启动屏幕?

I already have add a file "LaunchScreen.xib" but the app launches from the View Controller? 我已经添加了文件“ LaunchScreen.xib”,但是该应用程序是从视图控制器启动的吗?

thx for help 寻求帮助

I encountered this problem before. 我以前遇到过这个问题。 This is my solution, hope it can help you: 这是我的解决方案,希望它可以为您提供帮助:

  1. Targets->general->App icons and launch images->launch image source add a LaunchImage 目标->常规->应用程序图标和启动图像->启动图像源添加LaunchImage

  2. Click into Images.xcassets file, you add two png to LaunchImage 2x (640x960,iPhone4,4s), Retina 4 (640x1136,iPhone5,5s) 单击进入Images.xcassets文件,将两个png添加到LaunchImage 2x(640x960,iPhone4,4s),Retina 4(640x1136,iPhone5,5s)

  3. Add a png (640x1136) to Images.xcassets , it's name must be Default-568h@2x Images.xcassets添加png(640x1136),其名称必须为Default-568h @ 2x

  4. Run the app 运行应用

When you launch iPhone4~iPhone5s simulators, LaunchScreen is launched from LaunchImage , when you launch from iPhone6+, LaunchScreen is launched from LaunchScreen.xib . 当您启动iPhone4的〜iPhone5s模拟器, LaunchScreen从推出LaunchImage ,当你从iPhone6 +推出, LaunchScreen从推出LaunchScreen.xib

I have found the solution. 我找到了解决方案。 Under Target > General > App Icons and Launch Images select the correct Launch Screen File and it works on every Iphone (4s, 5, 5s, 6, 6plus) 在“目标”>“常规”>“应用程序图标和启动图像”下,选择正确的启动屏幕文件,该文件可在每个Iphone上使用(4s,5、5s,6、6plus)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM