xcode 属性不可用:iOS 8.0 之前版本上的第一个基线布局属性
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27557692/
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
Attribute Unavailable: First baseline layout attribute on iOS versions prior to 8.0
提问by djburdick
I'm getting the following warningin XCode 6.1.
我在XCode 6.1 中收到以下警告。
Attribute Unavailable: First baseline layout attribute on iOS versions prior to 8.0
属性不可用:iOS 8.0 之前版本上的第一个基线布局属性
I think, this is also causing my iOS 7.xbuilds to crash.
我认为,这也会导致我的iOS 7.x构建崩溃。
回答by djburdick
Found the issue. This new constraint was added to iOS 8.0 and isn't supported with previous versions.
发现问题。此新约束已添加到 iOS 8.0,以前的版本不支持。
To get rid of this warning and allow iOS 7 builds to work you need to:
1. Click on the warning in the side bar (this should highlight the offending constraint)
2. Change that constraint to something other than "First Baseline". "Center Y" worked well for me. You'll have to play with the options and can see the changes live to see which alternative works for you.
要消除此警告并允许 iOS 7 构建工作,您需要:
1. 单击侧栏中的警告(这应该突出显示违规约束)
2. 将该约束更改为“第一基线”以外的其他内容。“Center Y”对我来说效果很好。您必须尝试使用这些选项,并且可以实时查看更改以查看哪种替代方案适合您。
iOS 7 now builds again and warning is gone.
iOS 7 现在再次构建并且警告消失了。
回答by NRitH
We just ran into this exact same problem, but in our case, it didn't crash Xcode; it just drew the the view wildly out of place when run on an iOS 7 simulator. We fixed it by changing the constraint's item to plain ol' baseline
.
我们刚刚遇到了这个完全相同的问题,但在我们的例子中,它并没有使 Xcode 崩溃;在 iOS 7 模拟器上运行时,它只是将视图绘制得不合适。我们通过将约束的项目更改为普通 ol' 来修复它baseline
。