简体   繁体   English

故事板警告:iOS 8.0之前的第一个基线布局属性

[英]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.

相关问题 属性不可用:8.0之前的iOS版本的第一个基线布局属性 - Attribute Unavailable: First baseline layout attribute on iOS versions prior to 8.0 错误:iOS 8.0之前的情节提要参考 - Error: Storyboard references before ios 8.0 8.0之前的iOS版本上的属性不可用警告 - Attribute Unavailable warning on iOS versions prior to 8.0 Xcode 7中ios 8.0之前的自动首选最大布局宽度 - automatic preferred max layout width before ios 8.0 in Xcode 7 不推荐使用'lock':首先在iOS 8.0中弃用 - 使用-performBlockAndWait:代替 - iOS coredata警告 - 'lock' is deprecated: first deprecated in iOS 8.0 - Use -performBlockAndWait: instead - iOS coredata warning iOS故事板布局 - iOS storyboard layout IOS:在完成所有控件之前保持第一个视图控制器(StoryBoard) - IOS: Stay on the first view controller before complete all controls (StoryBoard) 打开故事板后的Xcode 8.0布局问题并执行更新框架 - Xcode 8.0 layout issue after open storyboard and perform update frames 在 storyboard 中使用材质样式时 iOS 13.0 之前的系统模糊样式警告 - System blur style before iOS 13.0 warning when using material style in storyboard iOS Storyboard布局-约束查询 - iOS Storyboard Layout - Constraint Query
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM