Search code examples
ioscocoa-touchuiviewcalayer

View not respecting constraint, why is that?


I have this view that has these constraints

enter image description here

When this view appears and I get its size on viewWillAppear I get the size as 320,568.

For a view that is locked to the left and right borders, nas an aspect ratio of 80:107 and is running on iPhone 5, I should be getting 320 x 428, right?

So why the view is full screen not respecting the constraint?

thanks


Solution

  • The views have not yet been laid out in viewWillAppear:. The frame will be correct in viewDidLayoutSubviews.