【iOS开发】使用Xcode8 添加Launch Image(启动图片)

一、Assets.xcassets -> + -> App icons & Launch Images -> New iOS Launch Image

这里写图片描述


二、设置为Launch Image的图片,最好为 .png格式

这里写图片描述


三、单击工程名称 -> General -> Launch Images Source改为LaunchImage ->Launch Source File的内容置为空

这里写图片描述


四、将LaunchScreen.storyboard的设置中的Use as Launch Screen取消

这里写图片描述


五、此时运行就能看到Launch Image了,记得把之前装的app卸载掉。


六、效果图(ipad && iphone)

iPad 启动页面

这里写图片描述

iPhone 启动页面

这里写图片描述


七、如果感觉Launch Image显示的时间太短,可以在AppDelegate.m文件里面添加一行 延迟 代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // 延迟进入应用,避免应用启动过快,导致启动图片一闪而过
    [NSThread sleepForTimeInterval:3.0];
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5

八、设备支持的启动图片尺寸大全

按照如下 设置Launch Image 尺寸

Device Orientation&&System Size Launch Image pixel
iPhone Portrait iOS 5,6 Retina 4 [email protected] 640 × 1136 pixels
iPhone Portrait iOS 7,8 Retina 4 [email protected] 640 × 1136 pixels
iPhone Portrait iOS 8 Retina HD 5.5 [email protected] 1242 × 2208 pixels
iPhone Portrait iOS 8 Retina HD 4.7 [email protected] 750 × 1334 pixels
iPhone Portrait iOS 5,6 1x LaunchImage.png 320 × 480 pixels
iPhone Portrait iOS 5,6 2x [email protected] 640 × 960 pixels
iPhone Portrait iOS 7,8 2x [email protected] 640 × 960 pixels
iPhone Landscape iOS 8 Retina HD 5.5 [email protected] 2208 × 1242 pixels
iPad Portrait iOS 7,8 1x LaunchImage.png 768 × 1024 pixels
iPad Portrait iOS 7,8 2x [email protected] 1536 × 2048 pixels
iPad Landscape iOS 7,8 1x LaunchImage.png 1024 × 768 pixels
iPad Landscape iOS 7,8 2x [email protected] 1536 × 2048 pixels

猜你喜欢

转载自blog.csdn.net/wenzfcsdn/article/details/62420688