问题描述
我不知道如何消除这个警告,我正在使用一个带有许多视图控制器(带有标签、文本字段和许多约束)的故事板,所有这些视图控制器的创建方式几乎相同.
>当我点击警告时,它会突出显示滚动视图中的 UILabel :
这个滚动视图有很多带有约束的 UILabels,我尝试了所有我能找到的东西,包括:
注意:您可能需要调整视图.就我而言,NSLayoutAttributeBaseline
运行良好.
NSLayoutAttributeFirstBaseline
对象的基线.对于包含多行文本的对象,这是最上面一行文本的基线.对象的基线.对于包含多行文本的对象,这是最上面一行文本的基线.适用于 iOS 8.0 及更高版本.
NSLayoutAttributeBaseline
对象的基线.对象的基线.适用于 iOS 6.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.
When I click on the warning it highlights a UILabel inside a scrollView :
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
This Warning doesn't cause my app to crash,I've tried on the simulator and an iPhone 4 (ios 7.1.2). But I'm worried about the AppStore approval.
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.
To identify the constraints search in Xcode with "firstBaseline". Change all constraints that are using NSLayoutAttributeFirstBaseline
.
Note: You may need to adjust your views. In my case NSLayoutAttributeBaseline
worked well.
这篇关于Storyboard 警告:iOS 8.0 之前的第一个基线布局属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!