我不知道如何摆脱这个警告,我正在使用一个包含许多 View Controller (带有标签、文本字段和许多约束)的 Storyboard,所有这些 View Controller 都是以几乎相同的方式创建的。
当我点击警告时,它会突出显示 scrollView 中的 UILabel :
这个 scrollView 有很多带有约束的 UILabel,我尝试了所有我能找到的东西,包括:Attribute Unavailable: First baseline layout attribute on iOS versions prior to 8.0
这个警告不会导致我的应用程序崩溃,我已经在模拟器和 iPhone 4 (ios 7.1.2) 上试过了。但我担心 AppStore 的批准。
最佳答案
我认为问题在于您有许多使用 NSLayoutAttributeFirstBaseline 的约束,当您单击警告时 Xcode 指向错误的约束。
使用“firstBaseline”在 Xcode 中识别约束搜索。更改所有使用 NSLayoutAttributeFirstBaseline 的约束。
注意:您可能需要调整您的观点。在我的例子中,NSLayoutAttributeBaseline 运行良好。
NSLayoutAttributeFirstBaseline
The object’s baseline. For objects with more than one line of text, this is the baseline for the topmost line of text. The object’s baseline. For objects with more than one line of text, this is the baseline for the topmost line of text. Available in iOS 8.0 and later.NSLayoutAttributeBaseline
The object’s baseline. The object’s baseline. Available in iOS 6.0 and later.
关于ios - Storyboard警告 : First baseline layout attribute before iOS 8. 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34207080/