iOS 8 Xcode 6:灰色约束有什么意义? [英] iOS 8 Xcode 6: What's the point of the grayed out constraints?

查看:142
本文介绍了iOS 8 Xcode 6:灰色约束有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xcode 6测试版中,当我删除约束时,它不会完全删除它,而是将其灰化。我认为这意味着约束在不同的大小类中使用,但似乎并非如此。另外,你如何永久删除这些约束?

In the Xcode 6 betas, when I delete a constraint, it doesn't remove it completely, but grays it out. I thought that was to imply that the constraint was used in a different size class, but that doesn't seem to be the case. Also, how do you permanently delete these constraints?

推荐答案

有几种方法可以从Storyboard中删除约束

There are a few ways to delete the constraints from the Storyboard


  1. 尽量不要从Storyboard对象中删除,因为有时不同的约束可以叠加在一起,您可能会删除错误的约束。因此,最好从文档大纲中删除。只需在文档大纲上突出显示要删除的约束,然后按键盘上的删除按钮即可。请参见下面的屏幕截图:

  1. Try not to delete from the Storyboard object because sometimes different constraints can stack together and you might delete the wrong one. So, it is better to delete from the Document Outline. Just highlight the constraint that you want to delete on the Document Outline and just press delete button on your keyboard. See screen shot below:

如果要清除所选视图中的所有约束,请选择视图(例如:A按钮),点击第三个按钮(解析自动布局问题按钮),点按清除约束

If you want to clear all the constraints from a selected view, Select the View (eg: A button), Tap on the Third Button (Resolve Auto Layout Issues Button), Tap Clear Constraints.

如果要清除视图控制器内所有视图的所有约束,请在故事板中突出显示右视图控制器对象,点击第三个按钮(解析自动布局问题按钮),点击视图控制器中的所有视图下的清除约束

If you want to clear all the constraints for all the views inside the view controller, Highlight the right view controller Object inside the storyboard, Tap on the Third Button (Resolve Auto Layout Issues Button), Tap Clear Constraints under the "All Views in the View Controller".

这篇关于iOS 8 Xcode 6:灰色约束有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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