LoginSignup
0
0

More than 5 years have passed since last update.

[iOS] Change the constraints value when use the auto layout

Posted at

When you use the auto layout, you will set some constraints to some view. Also maybe you want to change the value in the code. Just do this:

First drag the constraint you want to change to the code area to generate a constraint property.

Screen Shot 2014-11-28 at 12.03.52.png

Then do something like this:

//change the value of the constraint
bottomMarginConstraint.constant = 10
self.view.layoutIfNeeded()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0