Interface Builder: How to clean up the deleted con

2019-04-20 18:59发布

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.

enter image description here

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

enter image description here

I am using XCode 6 (6A313)

4条回答
等我变得足够好
2楼-- · 2019-04-20 19:03

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

查看更多
Melony?
3楼-- · 2019-04-20 19:05

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楼-- · 2019-04-20 19:09

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.

enter image description here

查看更多
我欲成王,谁敢阻挡
5楼-- · 2019-04-20 19:11

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

enter image description here

查看更多
登录 后发表回答