Interface Builder: How to clean up the deleted constraint?

混江龙づ霸主 提交于 2019-12-10 02:44:49

问题


I used command-delete to remove some constraints on the Map View widget in IB. Instead of being completely removed, the constraints are actually just faded as shown in the attached picture.

I have tried both saving the file and reopening the project, but it seems like they will not be removed by XCode.

How can I get them removed?

EDIT

This is what I see in the Size Inspector window

I am using XCode 6 (6A313)


回答1:


instead of using cmd and delete, select the view ,goto size inspector and delete the constraints there, here is the screen shot for your reference.




回答2:


Select it in the left panel and hit backspace to delete for good.




回答3:


if you want to remove particular object related all constraint then go to 'Resolve Autolayout Issue button' which appear little menu bar at the bottom of the editor select 'Clear Constraint'.

if you want to remove particular constraint of any object then select object -> go to size inpecter -> click on the first right button appear on constraing-> delete .

If you want to remove all constraint related to particular xib then go to 'Resolve Autolayout Issue button' and select 'Clear All Constraint in View'




回答4:


The constraints are faded because you removed them from the size inspector of one view but not from the other involved view.

If you add a constraint between 2 views you will see that constraint in the size inspector of both views. If you remove the constraint from the size inspector of one view, you will still see it in the size inspector of the other view, and you will also see the constraint faded in the view controller scene tree.

You can remove the constraint completely (from both views) by deleting it from the view controller scene tree (or from the very scene).



来源:https://stackoverflow.com/questions/25946812/interface-builder-how-to-clean-up-the-deleted-constraint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!