Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode11 how to disable Auto Layout?

In previous versions of Xcode, I was able to just open the storyboard and click almost anywhere, and in the file inspector, there was a button to disable auto layout. It seems like that's not an option anymore? Am I being forced to use auto layout now?

screenshot of storyboard file inpsector with no autolayout option

like image 643
Chase Roberts Avatar asked Sep 28 '19 10:09

Chase Roberts


People also ask

How do I enable auto layout in Xcode?

Create a new Xcode project. Select Single view app and name it AutoLayout. Leave the defaults unchecked: Use core data.


2 Answers

According Apple forum this option silently disappeared in Xcode 11.

You can still do it programmatically at viewDidLoad

for constraint in self.view.constraints {  
    constraint.isActive = false  
}

like image 147
Tom Avatar answered Oct 22 '22 05:10

Tom


Select your view in the storyboard and enable/disable LAYOUT automatic option in the right section

xcode11

like image 42
Eugene Pinchuk Avatar answered Oct 22 '22 06:10

Eugene Pinchuk