【问题标题】:iPhone 6 and 6 plus giving wrong frame, bounds values [duplicate]iPhone 6和6 plus给出错误的帧,边界值[重复]
【发布时间】:2014-12-01 16:25:06
【问题描述】:

我的应用程序是在 Xcode 5.1.1 上构建的,但一旦在 Xcode 6 上升级,就会面临帧尺寸问题,因为新尺寸 iPhone 6 的分辨率为 750x1334,但是,如果得到 480x300 的输出,是否有人在 iOS 8 上遇到过同样的问题, iPhone 6 甚至 iPhone 6 plus 模拟器

只需运行应用程序并 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);

输出:

宽度 - 480.000000,高度 - 300.000000 宽度 - 480.000000,高度 - 300.000000

我从 iOS 8 知道 bound.size 取决于方向,但我的问题是为什么它给我 480x300 而不是实际的 667x355

【问题讨论】:

  • 您是否将正确的启动屏幕添加到资产目录?
  • @rckoenes 添加启动屏幕使应用程序在兼容模式下运行意味着在顶部和底部留下黑带。
  • 您是否为 iPhone 6 和 6 plus 添加了特定的启动图像?它们被称为“Retina HD 5.5”和“Retina HD 4.7”
  • 添加 iPhone 6 和 iPhone 6 Plus 的启动图片
  • @Vijayyadav 谢谢兄弟,但启动图像解决了我的问题。

标签: ios objective-c xcode ios8 iphone-6


【解决方案1】:

您点击MainWindow.Xib 并选择窗口

Right Head side 在 FullScreen At Launch 和 Visible At Launch 上显示属性检查器的复选标记,我在 Image Follow us 上写下设置

【讨论】:

    猜你喜欢
    • 2014-11-07
    • 2014-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多