How Can I Disable Auto Layout?

I have some NSPanels that are not resizable, the App is not localized and and don't need Layout Constraints. Any time I edit an NSText field in the .xib, XCode 14.2 starts to report many errors: "Views without any layout constraints may clip their content or overlap other views." I spent a lot of time trying to make XCode stop reporting these warnings, but I can't. Sometimes quiting XCode or restarting my Mac will make these go away.

According to XCode Help: "Auto Layout is enabled by default. To disable Auto Layout, choose View > Inspectors > Show File Inspector and deselect the checkbox for Use Auto Layout."

Too bad there isn't any checkbox for Use Auto Layout in the file inspector for the .xib, the .panel's view or the NSText Field so I can't actually do this. The editor>Layout>Automatic menu item is disabled. Is there really any way to disable Auto Layout or has Apple decided to require it?

Answered by Tlaloc in 754026022

Thanks, this seems to fix it. Also locking the field to its parent view and making it un-resizeable with the auto-resizing pane seems to help. I'll try to mark this as solved.

Also I should mention that in the build settings "Interface Builder XIB Compiler Options" I can set Show Errors, Show Notices and Show Warnings to NO but XCode still reports these warnings. Also only some NSText fields generate this warning even though they are all configured the same except for their sizes and locations.

I can add layout constraints using the Editor>Resolve Auto Layout Issues>Add Missing Constraints. This works for SOME NSViews but in others with more interface items it creates a huge list of errors.

If you select the field and then look at the size inspector, what does it say next to Layout, "Autoresizing Mask" or "Inferred (Autoresizing Mask)"? In my experience, if I set all my items to "Autoresizing Mask", then Xcode won't bug me about constraints.

Accepted Answer

Thanks, this seems to fix it. Also locking the field to its parent view and making it un-resizeable with the auto-resizing pane seems to help. I'll try to mark this as solved.

How Can I Disable Auto Layout?
 
 
Q