Update interface buidler to match constraints

Viewed 587

In XCode interface builder, when I define some constraints that are different than "current" state of control, there will be red lines, now I want to apply constraints and remove red lines, what should I do. Check attached image, I want to make bottom space in A exactly like what I defined in B, which is 8.enter image description here

2 Answers

Red lines usually mean that you miss some constraints and Xcode doesn't know exactly where to place it (in your case probably a height constraint of the label).

If all constraints are set correctly but the element is at a wrong position it shows an orange rectangle where it belongs to. In that case you can select the element and press Cmd + alt + = to move it to it's right spot.

Sometimes the following notifications appear, if you click on them you have options that will trigger constraints update on the Interface builder. Also on the menu, go to Editor and activate Automatically Refresh Views.

enter image description here

Related