How do I (easily) delete a constraint in Interface Builder in Xcode 6

前端 未结 6 1061
栀梦
栀梦 2021-02-06 21:20

Assume you\'ve selected an object and you have the Size Selector in the Utilities panel open. You can see the list of constraints applied to the object. In the list of constrain

6条回答
  •  囚心锁ツ
    2021-02-06 22:10

    The selected answer is incomplete. When you delete the constraint from the Size Inspector, you are leaving behind the constraint object in the Document Outline pane. It is greyed out, meaning it is not used, but still exists and, what's worse, will affect auto layout with errors, warnings or conflicting constraints and you will go crazy until you also delete them from the Document Outline pane.

    So:

    1. Delete the constraint from the Size Inspector as in the accepted answer
    2. Delete any greyed out constraints from the Document Outline
    

    Live a happy, constraint-free life.

提交回复
热议问题