xcode iPhone 6 和 6 plus 给出错误的框架、边界值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26232686/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iPhone 6 and 6 plus giving wrong frame, bounds values
提问by Rein rPavi
I have my app build on Xcode 5.1.1 but once upgraded on Xcode 6 facing the problem with frame size as per new sizes iPhone 6 has 750x1334 resolution but, getting output 480x300 does anyone has faced the same problem with iOS 8, iPhone 6 or even on iPhone 6 plus simulators
我的应用程序是在 Xcode 5.1.1 上构建的,但是一旦在 Xcode 6 上升级,就会面临帧尺寸问题,因为 iPhone 6 的分辨率为 750x1334,但是,输出 480x300 是否有人在 iOS 8、iPhone 6 或即使在 iPhone 6 plus 模拟器上
just run the app and NSLog the following lines
只需运行应用程序和 NSLog 以下行
NSLog(@"Width - %f, Height - %f",self.view.frame.size.width,self.view.frame.size.height);
NSLog(@"Width - %f, Height - %f",self.view.bounds.size.width,self.view.bounds.size.height);
output:
输出:
Width - 480.000000, Height - 300.000000 Width - 480.000000, Height - 300.000000
宽度 - 480.000000,高度 - 300.000000 宽度 - 480.000000,高度 - 300.000000
I know from iOS 8 bound.size is orientation dependent but my question is why it giving me 480x300 in place of actual 667x355
我从 iOS 8 知道 bound.size 取决于方向,但我的问题是为什么它给我 480x300 代替实际的 667x355
回答by Vijay yadav
You Click on MainWindow.Xib
and Select The Window
您单击MainWindow.Xib
并选择窗口
Right Head side Show the Attribute inspector in checkmark on FullScreen At Launch And Visible At Launch and i write Down setup on Image Follow us
右侧头部在全屏启动时在复选标记中显示属性检查器并在启动时可见,我在图像上写下设置关注我们