Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios iPhone 5/5S上的游戏场景渲染不正确_Ios_Swift_Sprite Kit - Fatal编程技术网

Ios iPhone 5/5S上的游戏场景渲染不正确

Ios iPhone 5/5S上的游戏场景渲染不正确,ios,swift,sprite-kit,Ios,Swift,Sprite Kit,我试图在游戏场景中显示背景图像。当我运行它时,它在除了iPhone5/5S之外的所有设备上都显示良好。下面的屏幕截图显示了模拟器在iPhone4S和iPhone5上的外观 以下是我显示背景图像的方式: // set background image let backgroundImage = SKSpriteNode(imageNamed: "bg") backgroundImage.position = CGPointMake(frame.size.width/2,

我试图在游戏场景中显示背景图像。当我运行它时,它在除了iPhone5/5S之外的所有设备上都显示良好。下面的屏幕截图显示了模拟器在iPhone4S和iPhone5上的外观

以下是我显示背景图像的方式:

    // set background image
    let backgroundImage = SKSpriteNode(imageNamed: "bg")
    backgroundImage.position = CGPointMake(frame.size.width/2, frame.size.height/2)
    addChild(backgroundImage)

我已经在模拟器和实际设备上进行了测试,但仍然存在这个问题

如果您没有为所有屏幕大小添加启动图像,有时会发生这种情况。就是这样!虽然我只有iPhone 6/6 plus的发布图片。非常感谢。这正是当你不添加发布图像时所发生的情况,出于兼容性目的,它将该设备视为iPhone4/4s应用程序