简体   繁体   English

iOS 7模拟器与设备与Storyboard UI的差异

[英]iOS 7 simulator vs device vs Storyboard UI differences

Upgrading my app for iOS 7 is a challenge. 升级我的iOS 7应用程序是一项挑战。 The UI is built from IB but does not use auto layout. UI由IB构建,但不使用自动布局。

On IB I unchecked the Extend Edges boxes for my view controllers. 在IB上,我取消选中了我的视图控制器的“扩展边缘”框。 Now in IB it all looks correct for iOS 7 and iOS 6. 现在在IB中,它看起来对于iOS 7和iOS 6都是正确的。

Extend Edges unchecked: 未选中扩展边缘:

IB扩展边缘

Storyboard appearance: 故事板外观:

IB按钮在此输入图像描述

Segmented Control tint: 分段控制色调:

在此输入图像描述

On Simulator the content still extends behind the navbar unless I make the navbar opaque. 在模拟器上,内容仍然延伸到导航栏后面,除非我使导航栏不透明。 It seems to just ignore the fact the Extend Edges where unchecked. 它似乎忽略了未经检查的Extend Edges这一事实。

Simulator Appearance: 模拟器外观:

在此输入图像描述在此输入图像描述

On an iPhone 5 running iOS 7 the content also extends under the navbar. 在运行iOS 7的iPhone 5上,内容也在导航栏下扩展。 In addition, all the navbar buttons have iOS 6 look. 此外,所有导航栏按钮都具有iOS 6外观。 The segmented control also seems to be ignoring the tint and displaying black on black. 分段控件似乎也忽略了色调并在黑色上显示黑色。

iPhone 5 running iOS 7 Appearance: iPhone 5运行iOS 7外观:

在此输入图像描述在此输入图像描述

Can someone explain what's happening here and how I can get the iOS 7 appearance on IB, Simulator, and device to match? 有人可以解释这里发生了什么以及如何在IB,模拟器和设备上获得iOS 7外观以匹配?

I spent days on this and was astounded by the variety of displays I saw. 我花了好几天时间对我看到的各种显示器感到震惊。 Not only were the buttons not displaying correctly but I also was getting different UIView frame dimensions on the simulator between iOS 6 & 7. I also saw differences in the frame between the simulator and iOS 7 device. 这些按钮不仅没有正确显示,而且我还在iOS 6和7之间的模拟器上获得了不同的UIView框架尺寸。我还看到了模拟器和iOS 7设备之间框架的差异。

I was tracking down a different problem and realized my iOS device showed up twice on Xcode 5's destination menu. 我正在追踪一个不同的问题,并意识到我的iOS设备在Xcode 5的目标菜单上出现了两次。 I found out that occurs when you have more than one iOS SDK installed in Xcode. 我发现当你在Xcode中安装了多个iOS SDK时会发生这种情况。 I removed the iOS 6.1 SDK from the Xcode 5 application and all my issues went away. 我从Xcode 5应用程序中删除了iOS 6.1 SDK,所有问题都消失了。

I can't be sure it wasn't related to me picking a different device from the menu each time. 我不能确定这与我每次从菜单中选择不同的设备无关。 I understand one shows up for each SDK installed. 我知道每个SDK都会安装一个。 They were named the same so I never knew which one to choose. 它们的名字相同,所以我从来不知道选择哪一个。

Again, not sure this caused all my problems but I don't have them now. 再次,不确定这会导致我所有的问题,但我现在没有。 Hopefully this will save someone a ton of time tracking down UI anomalies. 希望这可以节省大量时间来跟踪UI异常。

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

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