Search code examples
xcodeautolayout

Layout of a view controller not adapting to a bigger size screen


2 of my View controllers have a freeform size to accommodate a scrollview. When I change the View size from Iphone 7 to Ipad all my view controllers adjust size except the 2 with the Freeform size, hence the auto-layout is not working. Same when I run in the simulator. I'm new at this and would appreciate all of your help

enter image description here

This is my storyboard when I change the view to Ipad

enter image description here


Solution

  • They don't adjust it's size just because you set it's simulated size to freeform. That's why they ignore the type of the device you have selected on the storyboard. This attribute is only for the design purpose and should not impact your layout in any way. If you experience layout problems on iPad there probably is something wrong with your constraints.

    In this post, you can find more information about the simulated size attribute. https://stackoverflow.com/a/16280477/1692080

    Here you can find the direct explanation of the difference between fixed and freeform. https://stackoverflow.com/a/32820018/1692080