Jean-Francois Laurin
Jean-Francois Laurin

Reputation: 175

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

Upvotes: 2

Views: 800

Answers (2)

Kamil Szostakowski
Kamil Szostakowski

Reputation: 2163

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

Upvotes: 1

Emma Labbé
Emma Labbé

Reputation: 697

You need to use autolayout to adapt your Views to the screen size. Select a view in your ViewController, click the button which is in the screenshot and Reset To Suggested Constraints below All Views in ViewController

Screenshot

Upvotes: 0

Related Questions