Reputation: 1125
I'm using Auto Layout and Size Classes. I have a test view under the main view like so:
With all 6 constraints:
The expected result should have the test view have the exact same Rect value. But it is not. What am i doing wrong? How can I achieve such behaviour?
viewDidLoad Logs:
iPhone 5:
Main View - NSRect: {{0, 0}, {320, 568}}
Test View: NSRect: {{0, 0}, {600, 600}}
iPhone 6:
Main View - NSRect: {{0, 0}, {375, 667}}
Test View: NSRect: {{0, 0}, {600, 600}}
Upvotes: 0
Views: 38
Reputation: 1790
As specified in this answer, always 600x600, you need to print your log in viewDidLayoutSubviews. Does the view appear correctly though?
Also you don't need the width and height constraints if you set the edges the same as the parent, but that's a minor thing.
Hope this helps, comment if you still have a problem, good luck.
Upvotes: 1