[英]Storyboard warning : First baseline layout attribute before iOS 8.0
I can't figure out how to get rid of this warning, I'm using a storyboard with many viewControllers (with labels, textfields and a lot of constraints ) all of them have been created almost the same way. 我无法弄清楚如何摆脱这个警告,我正在使用一个带有许多viewControllers的故事板(带有标签,文本字段和许多约束),所有这些都是以几乎相同的方式创建的。
When I click on the warning it highlights a UILabel inside a scrollView : 当我点击警告时,它会在scrollView中突出显示UILabel:
This scrollView has many UILabels with constraints, I tried everything I could find on so including : Attribute Unavailable: First baseline layout attribute on iOS versions prior to 8.0 这个scrollView有许多带有约束的UILabel,我尝试了我能找到的所有东西,包括: 属性不可用:iOS版本之前的第一个基线布局属性
This Warning doesn't cause my app to crash,I've tried on the simulator and an iPhone 4 (ios 7.1.2). 这个警告不会导致我的应用程序崩溃,我已经尝试过模拟器和iPhone 4(ios 7.1.2)。 But I'm worried about the AppStore approval. 但我很担心AppStore的批准。
I think the issue is you have many constraints that are using NSLayoutAttributeFirstBaseline
and when you click on the warning Xcode is pointing to wrong constraint. 我认为问题是你有许多使用NSLayoutAttributeFirstBaseline
约束,当你点击警告Xcode指向错误的约束。
To identify the constraints search in Xcode with "firstBaseline". 使用“firstBaseline”在Xcode中识别约束搜索。 Change all constraints that are using NSLayoutAttributeFirstBaseline
. 更改使用NSLayoutAttributeFirstBaseline
所有约束。
Note: You may need to adjust your views. 注意:您可能需要调整视图。 In my case NSLayoutAttributeBaseline
worked well. 在我NSLayoutAttributeBaseline
效果很好。
NSLayoutAttributeFirstBaseline 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. 适用于iOS 8.0及更高版本。NSLayoutAttributeBaseline NSLayoutAttributeBaseline
The object's baseline. 对象的基线。 The object's baseline. 对象的基线。 Available in iOS 6.0 and later. 适用于iOS 6.0及更高版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.