今年苹果发布会已经结束,但人们貌似对iPhone6和iPhone6plus不太感兴趣,而对iWatch非常期待。这次苹果一次发布两种屏幕大小的手机,而且与之前的机型的屏幕大小都不一样。这对开发者来说,无疑是最担心的事了,之前的app在iPhone6和iPhone6Plus上会不会布局全乱了呢?
不用担心苹果肯定会考虑到这些问题的:
之前的坐标系我们都知道是320*480和320*568;那么新版的iPhone坐标系又会是多少呢?我用Xcode6GM版新建了一个项目,分别在storyboard、代码、xib上测试之后的数据为:
iPhone6:
2014-09-15 11:15:52.104 X6Test[1766:62602] SB screen bounds = {{0, 0}, {375, 667}}
2014-09-15 11:15:52.105 X6Test[1766:62602] SB view bounds = {{0, 0}, {375, 667}}
2014-09-15 11:15:53.304 X6Test[1766:62602] code screen bounds = {{0, 0}, {375, 667}}
2014-09-15 11:15:53.305 X6Test[1766:62602] code view bounds = {{0, 0}, {375, 667}}
2014-09-15 11:15:57.913 X6Test[1766:62602] xib screen bounds = {{0, 0}, {375, 667}}
2014-09-15 11:15:57.913 X6Test[1766:62602] xib view bounds = {{0, 0}, {600, 600}}
iPhone6Plus
2014-09-15 11:24:07.164 X6Test[1855:66991] SB screen bounds = {{0, 0}, {414, 736}}
2014-09-15 11:24:07.165 X6Test[1855:66991] SB view bounds = {{0, 0}, {414, 736}}
2014-09-15 11:25:06.637 X6Test[1855:66991] code screen bounds = {{0, 0}, {414, 736}}
2014-09-15 11:25:06.638 X6Test[1855:66991] code view bounds = {{0, 0}, {414, 736}}
2014-09-15 11:25:08.834 X6Test[1855:66991] xib screen bounds = {{0, 0}, {414, 736}}
2014-09-15 11:25:08.834 X6Test[1855:66991] xib view bounds = {{0, 0}, {600, 600}}
此外,用Xcode6打开以前的老项目,新建的类的坐标系也会和之前的一样。