Interface Builder: How to clean up the deleted con

2019-04-20 18:40发布

问题:

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).