Storyboard 警告:iOS 8.0 之前的第一个基线布局属性 [英] Storyboard warning : First baseline layout attribute before iOS 8.0

查看:45
本文介绍了Storyboard 警告:iOS 8.0 之前的第一个基线布局属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何消除这个警告,我正在使用一个带有许多视图控制器(带有标签、文本字段和许多约束)的故事板,所有这些视图控制器的创建方式几乎相同.

>

当我点击警告时,它会突出显示滚动视图中的 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.

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.

这篇关于Storyboard 警告:iOS 8.0 之前的第一个基线布局属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆