1

Let's say that i have a view loaded from a nib that has layout constraints changing its appearance depending on its size.

I load the view from the nib and get a reference to UIView. I then manually change view's frame (e.g make it really big or small) and add it as a subview to already visible view.

Will the constraint system automatically figure that frame change should trigger auto layout recompilation? How does auto layout mix with manual frame/bounds changes? Where can i get detailed documentation on this?

Terminus
  • 925
  • 10
  • 23
  • The Auto Layout Guide may be of assistance. found at this [link](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html) – Bamsworld Feb 26 '15 at 12:24

1 Answers1

0

No, if your want the autolayout to re-apply you need to call [view layoutIfNeeded], and if you set frames before the layout finished to apply, it will be override. My advice is to modify constraints instead of setting frames.

las
  • 288
  • 2
  • 8
  • So the constraint system is incompatible with manual frame settings? Where can i get docs on this? – Terminus Feb 26 '15 at 12:16
  • It can coexist but you have to be careful, see the documentation : https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/AdoptingAutoLayout/AdoptingAutoLayout.html#//apple_ref/doc/uid/TP40010853-CH15-SW1 – las Feb 26 '15 at 13:12