来自资产的Spritekit/Universal图像未显示在iOS 9上? [英] Spritekit/Universal images from assets not showing up on iOS 9?

查看:49
本文介绍了来自资产的Spritekit/Universal图像未显示在iOS 9上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SpriteKit和Swift创建了一个通用应用程序. 用户已在iOS 9上发送了错误报告,其中精灵节点图像显示为白色/空白.但是我无法在模拟器中重现此内容. 未显示的图像在images.xcassets中都是特定于设备的.

I made a universal app using SpriteKit and Swift. Users have sent out bug reports on iOS 9 where sprite node images are showing up white/blank. But I haven't been able to reproduce this in the simulator. The images that don't show up are all device-specific in images.xcassets.

显示的图像是images.xcassets中通用的图像.

The images that do show up are the ones that are universal in images.xcassets.

该如何解决(除了使它们不特定于设备),并且可能是XCode/iOS错误?

What could I do to solve this (besides making them not device-specific) and could this possibly be an XCode/iOS bug?

推荐答案

是的,这是iOS 9的错误.

Yeah it's a bug for iOS 9.

到目前为止,有效的方法是重建所有内容,并在每次调用图像时添加图像的格式扩展名.例如,如果您的图片是.png,那么当您说类似以下内容时:

What has worked so far is rebuilding everything and adding the format extension of the image whenever you call it. So for example, if your image is .png, then when you say something like:

SKSpriteNode *sprite = [SKSpriteNode spriteNodeWithImageNamed:@"myImage.png"];

尝试此操作,而不要使用字符串"myImage",该字符串通常适用于以前的操作系统.

Try this instead of using the string "myImage", which would normally work for previous OS's.

这篇关于来自资产的Spritekit/Universal图像未显示在iOS 9上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆