简体   繁体   English

iOs 8在同一设备上显示的同一应用程序与iOs7不同

[英]iOs 8 show same app on same device differently than iOs7

I'm having problems developing a game for two different screen sizes (the iPhone 4 and 5). 我在为两种不同屏幕尺寸(iPhone 4和5)开发游戏时遇到问题。 This image is from the iPhone 4 simulator, this is how the game should look on every device: 此图片来自iPhone 4模拟器,这是游戏在每台设备上的外观: 在此处输入图片说明

iPhone 5 simulator with iOS 7: 装有iOS 7的iPhone 5模拟器:

在此处输入图片说明

But that one is from an iphone 5 too, but with ios 8: 但是那也是来自iphone 5,但来自ios 8: 在此处输入图片说明

Do I have to set up three different coordinates for each object, one for the iPhone 4 and 5 with iOS 7 and another one for iOS 8? 我是否需要为每个对象设置三个不同的坐标,一个用于iOS 7的iPhone 4和5,另一个用于iOS 8?

Will the iphone 6 and 6+ have different coordinates? iPhone 6和6+的坐标会不同吗?

You can set positions relative to the screen size so that you do not have to specify coordinates for each. 您可以相对于屏幕尺寸设置位置,从而不必为每个屏幕指定坐标。

Ex. 例如 Sprite.position = CGPointMake(self.frame.size.width*5, self.frame.size.height*75)

This will position your sprite center towards the top of the screen. 这会将您的精灵中心定位在屏幕顶部。 This way, objects will be placed in the same relative location for each screen size. 这样,对于每种屏幕尺寸,对象将被放置在相同的相对位置。

Your images will automatically scale. 您的图像将自动缩放。

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

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