问题描述
在Swift中的Xcode 6 beta 3中加载带有png图像的UIImages,如下所示:
When loading UIImages with png images in Xcode 6 beta 3 in Swift as follows:
PipsImg = (UIImage(named: "Die-1"))
或
PipsImg = [(UIImage(named: "Die-1")),(UIImage(named: "Die-2"))]
来自Images.xcassets文件夹中的相关图像,我收到以下致命的运行时错误:
from associated images stored in the Images.xcassets folder, I receive the following fatal runtime errors:
SimpleAnimation[680:60b] Unsupported pixel format in CSI
SimpleAnimation[680:60b] Unable to create unsliced image from csi bitmap data.
这似乎在测试版4中得到解决,但是会留下一点点有时这些回归
推荐答案
这是由Xcode 6中的一个错误引起的(此时为beta 3)。它似乎仅在您的构建目标是iOS 7.x时出现
This is caused by a bug in Xcode 6 (beta 3 at this time). It appears to occur only if your build target is iOS 7.x
要解决此问题:
1)从Images.xcassets容器中删除文件。
1) delete the files from the Images.xcassets container.
2)将图像直接放入Supporting Files文件夹中。
2) place the images directly into the "Supporting Files" folder.
注意:不需要在代码中添加.png扩展名,这是一个干净的解决方法。
Note: It is not required to add the ".png" extension within your code, making this a clean workaround.
请为Apple创建一个RADAR(错误报告)。
Please create a RADAR (bug report) to Apple.
这篇关于Xcode 6(beta 3):CSI中不支持的像素格式或无法从csi位图数据创建未切割的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!