简体   繁体   English

iOS 7模拟器与真正的iPhone无法解释的差异

[英]iOS 7 Simulator vs Real iPhone unexplained differences

I am working on a fix for iOS 7 and having a problem. 我正在修复iOS 7并遇到问题。 When I run my app on real device (iPhone 4S iOS 7), the screen looks different than when I run the same app on iPhone 3.5 inches iOS 7 Simulator. 当我在真实设备(iPhone 4S iOS 7)上运行我的应用程序时,屏幕看起来与我在iPhone 3.5英寸iOS 7模拟器上运行相同应用程序时不同。 I am trying to understand why and what is the reason for that, if anyone can help it would be great! 我试图理解为什么以及为什么这样做,如果有人能帮助它会很棒!

First screenshot from Simulator, second picture from Device: 来自Simulator的第一张截图,来自Device的第二张图片:

SOLVED: The app on the real iPhone has a base SDK 6.0 and the app that is on the Simulator has base SDK 7.0. 解决:真正的iPhone上的应用程序有一个基础SDK 6.0和模拟器上的应用程序具有基础SDK 7.0。 So I guess the real device knew how to compensate for the low SDK base, unlike the simulator which behaved totally in a SDK 7.0 environment and thats why it was showing differently. 所以我想真正的设备知道如何弥补低SDK基础,不像完全在SDK 7.0环境中表现的模拟器,这就是为什么它显示不同。 thanks! 谢谢!

模拟器:

真实设备:

For anyone else reading this, Roy's 'Solved' comment above is correct. 对于其他读这篇文章的人来说,上面的Roy''Solved'评论是正确的。

I have gone into Xcode after the update and it had automatically updated my Base SDK to the latest 'iOS 7.0'. 我在更新后进入Xcode并自动将我的Base SDK更新到最新的'iOS 7.0'。

After changing this back to 'iOS 6.1' - both the Simulator and Device are now working the same, as expected on iOS 7. 将此更改回“iOS 6.1”后 - 模拟器和设备现在的工作方式与iOS 7上的预期相同。

Not trying to steal Roy's thunder (whose saved me a good numbers of hours - thank you), just summarizing to others how to quickly fix the issue. 并没有试图窃取罗伊的雷声(他为我节省了很多时间 - 谢谢),只是向其他人总结如何快速解决问题。

Ralph 拉尔夫

与建议的解决方案相反,Apple文档建议将Base SDK设置为最新的iOS https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html#//apple_ref/doc / uid / TP40012582-CH28-SW37 ,所以必须有一个更好的解决方案

I also faced same issue.. 我也面临同样的问题..

I solved by adding below code at viewDidLoad method..of view controller. 我通过在viewDidLoad方法...视图控制器中添加以下代码来解决。

if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout = UIRectEdgeNone;

Hope it helps..Thanks. 希望它有所帮助......谢谢。

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

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