图像在 iPad 2 模拟器上不显示 iOS 9
Images doesn't show on iPad 2 simulator with iOS 9
在资产目录中,我为 iPhone 和 iPad 设备设置了名称为 "panda" 的图像。 iPhone 3 张图像和 iPad
2 张图像
当我 运行 应用程序在 iPad Air 上时,iPad Air 2,iPad Retina,iPad 2 with iOS 8.4该图像将在点击时显示,但在 iPad 2 和 iOS 9!
上没有任何反应
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
/* Called when a touch begins */
for touch in touches {
let location = touch.locationInNode(self)
let sprite = SKSpriteNode(imageNamed:"panda")
print(sprite)
sprite.position = location
let action = SKAction.rotateByAngle(CGFloat(M_PI), duration:1)
sprite.runAction(SKAction.repeatActionForever(action))
self.addChild(sprite)
}
}
使用版本7.0
这里是设置
// 编辑 1.0
显然这是一个错误,尚未修复
https://forums.developer.apple.com/thread/4268
https://forums.developer.apple.com/message/36854#36854
尝试 (Objective-C)
UIImage *img = [UIImage imageNamed:@"image"];
SKTexture *textureBg = [SKTexture textureWithImage:img];
SKSpriteNode *nodeBg = [SKSpriteNode spriteNodeWithTexture:textureBg];
在资产目录中,我为 iPhone 和 iPad 设备设置了名称为 "panda" 的图像。 iPhone 3 张图像和 iPad
2 张图像当我 运行 应用程序在 iPad Air 上时,iPad Air 2,iPad Retina,iPad 2 with iOS 8.4该图像将在点击时显示,但在 iPad 2 和 iOS 9!
上没有任何反应override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
/* Called when a touch begins */
for touch in touches {
let location = touch.locationInNode(self)
let sprite = SKSpriteNode(imageNamed:"panda")
print(sprite)
sprite.position = location
let action = SKAction.rotateByAngle(CGFloat(M_PI), duration:1)
sprite.runAction(SKAction.repeatActionForever(action))
self.addChild(sprite)
}
}
使用版本7.0
这里是设置
// 编辑 1.0
显然这是一个错误,尚未修复
https://forums.developer.apple.com/thread/4268 https://forums.developer.apple.com/message/36854#36854
尝试 (Objective-C)
UIImage *img = [UIImage imageNamed:@"image"];
SKTexture *textureBg = [SKTexture textureWithImage:img];
SKSpriteNode *nodeBg = [SKSpriteNode spriteNodeWithTexture:textureBg];