gpt4 book ai didi

ios7 - XCode 6.0.1 ios 7 自动布局

转载 作者:行者123 更新时间:2023-12-04 15:57:35 25 4
gpt4 key购买 nike

我发现在 XCode 6 中为 ios 7 构建的应用程序与为 ios 8 构建的相同应用程序具有不同的行为。自动布局约束有问题。例如,如果我在 XCode 6 for ios 7 中在 sumulator 或设备中构建应用程序,一些底部和尾随空格将不起作用,但如果我在 XCode 6 for ios 8 或在 XCode 5 for ios 7 中构建它们,应用程序可以正常工作。所以我认为当您使用 XCode 6 构建时,ios 7 存在一些问题。如果有人遇到同样的问题,如何解决?

最佳答案

In iOS 7, cells’ content views sized themselves via autoresizing masks. In iOS 8, this was changed, cells stopped using the autoresizing masks and started sizing the content view in layoutSubviews. If a nib is encoded in iOS 8 and then decode it on iOS 7, you’ll have a content view without an autoresizing mask and no other means by which to size itself. So if you ever change the frame of the cell, the content view won’t follow.

Apps being deploying back to iOS 7 will have to work around this by sizing the content view itself, adding autoresizing masks, or adding constraints. I guess this means that it's not a bug in XCode 6, but an incompatibility between the iOS 8 SDK and iOS 7 SDK, which will hit you if you upgrade to Xcode 6, because it will automatically start using the iOS 8 SDK.

关于ios7 - XCode 6.0.1 ios 7 自动布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25993925/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com