简体   繁体   English

Xcode 6迁移到图像资产问题 - 黑色启动屏幕

[英]Xcode 6 Migrating to Images assets issues — Black launch screen

I updated my application to use Image Asset for App Icon and Launch Images i set both with appropriate image size according to Apple Doc. 我更新了我的应用程序以使用Image Asset for App Icon和Launch Images我根据Apple Doc设置了适当的图像大小。 The issue that I have that for Iphone and the simulator for (4S/5/5S) the launch image/screen is always black except for Iphone 6+ but it works fine on iPad. 我对Iphone和(4S / 5 / 5S)模拟器的启动图像/屏幕的问题总是黑的,除了Iphone 6+,但它在iPad上工作正常。 I looked at couple of post here and nothing have worked as follow 我在这里查看了几个帖子,没有任何工作如下

         1) deleting the asset catalog and creating a new one      
         2) adding @2x and 3@x to each file before adding to the catalog
         3) removing and redeploying the application 

      Anyone had that issue when porting image catalog ? Im using Xcode 6  
      Targeting ios 7 and 8

Thanks Mike 谢谢迈克

       Update 1
          When disabling landscape launch screen appears normally
          something i noticed before doing, so on either the device and the simulator
          the application starts in landscape even if the device is held in portrait 
          and then it rotate to portrait. Still trying to solve that issue now

The following steps are worked for me: 以下步骤适用于我:

  1. Add the images to the project (root directory or Resources folder) with the following nomination (I will describe them into the Portrait launchimages): Degault.png (3.5 inch), Default-567h@2x (4 inch), Default-667h@2x (iPhone 6), Default-736@2x (iPhone 6plus). 使用以下提名将图像添加到项目(根目录或资源文件夹)中(我将其描述为Portrait launchimages):Degault.png(3.5英寸),默认值为567h @ 2x(4英寸),默认值为667h @ 2x(iPhone 6),默认值736 @ 2x(iPhone 6plus)。
  2. Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to not use asset catalog ('Do not use asset catalogs'). 转到常规选项卡上的目标设置,应用程序图标和启动图像 - >将启动图像源设置为不使用资产目录('不使用资产目录')。
  3. Remove the LaunchImage asset from your main image asset 从主图像资源中删除LaunchImage资产
  4. Go to the target settings, App Icons And Launch Images on the General tab -> Set the Launch Image Source to use asset catalog 转到常规选项卡上的目标设置,应用程序图标和启动图像 - >设置启动图像源以使用资产目录
  5. The XCode 6 is going to ask you about image asset migration from the existing images. XCode 6将向您询问有关现有图像的图像资产迁移的信息。 Just click to 'Migrate'. 只需点击“迁移”即可。

And it worked for me for each kind of devices on iOS7, iOS8. 它适用于iOS7,iOS8上的各种设备。 Note: If you check the new LaunchImage asset, than you can see it is really strange. 注意:如果你检查新的LaunchImage资产,你会发现它真的很奇怪。 It seems to contain only a few image without the images with iPhone6 or iPhone 6plus resolution. 它似乎只包含一些没有iPhone6或iPhone 6plus分辨率图像的图像。

I found that if I go to the app target general tab and remove all device orientations, the launch image will show again (ie the black screen goes away). 我发现,如果我转到应用目标常规标签并删除所有设备方向,则会再次显示启动图像(即黑屏消失)。 After running the app, I then went back to the app target general tab and restored the desired device orientation and the launch images continue to work as desired. 运行应用程序后,我返回到应用程序目标常规选项卡并恢复所需的设备方向,并且启动图像继续按照需要工作。

(My answer should be in the comment section but I can't post it there due to my reputation) (我的答案应该在评论部分,但由于我的声誉,我不能在那里发布)

May be these are very basic steps but: 可能这些是非常基本的步骤但是:

  • Have you tried doing a full clean and deleting the derived data? 您是否尝试过彻底清理并删除派生数据?
  • Have you checked the General tab of your target, under App Icons and Launch Images? 您是否在应用程序图标和启动图像下选中了目标的常规选项卡?

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

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