Anthony Kong
Anthony Kong

Reputation: 40664

Interface Builder: How to clean up the deleted constraint?

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)

Upvotes: 10

Views: 2051

Answers (4)

Ferran Maylinch
Ferran Maylinch

Reputation: 11529

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

Upvotes: 1

Adam Waite
Adam Waite

Reputation: 18855

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

enter image description here

Upvotes: 10

user2493047
user2493047

Reputation: 119

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'

Upvotes: 1

Mounika Vangala
Mounika Vangala

Reputation: 396

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

Upvotes: 2

Related Questions