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?
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
}
Select your view in the storyboard and enable/disable LAYOUT automatic option in the right section
In Interface Builder, highlight the constraint(s) on the left side and uncheck "Installed" in the Attributes Inspector
Related
In one of my Xcode projects, the SwiftUI Inspector won't show anymore.
Example:
When I create a new project, I have the inspector:
Any idea what is causing this? Can I maybe reset the settings of the project?
You must have Canvas opened to have SwiftUI context menu items in Editor (including SwfitUI Inspector)
XCode 12 Update
Even after enabling the Canvas if the inspect option is not showing up because, Its been renamed to Show SwiftUI Inspector
Canvas
https://i.stack.imgur.com/BmpVW.png
Editor
https://i.stack.imgur.com/D74Ml.png
In the past I can find Panel available in Interface Builder's Library, but in Xcode 8, I searched the whole library in storyboard editor, no Panel available. Has Apple just removed NSPanel or I got something wrong?
Assuming you want to add a second window (as a panel) to your storyboard, add a new window controller. Then select its window and change its class to NSPanel. In the attributes inspector you will find that your panel can then be changed to regular, utility or HUD.
For Cocoa apps, I find that Nibs/Xibs are sometimes easier to work with than storyboards.
I have a project that I created before auto layout came out. My projects has two storyboards - a main one (quite complex, 10+ screens) and a secondary one (just a few screens). I'm trying to enable auto layout for my project, but am unable to do so for the main storyboard.
I'm accessing the file inspector, then checking the "Use Autolayout" checkbox in the Interface Builder Document panel. While this worked fine for the secondary storyboard, when I click the checkbox for the main one I'm getting the beachball for a few seconds (and the previously empty checkbox turns to a "-"), then a lock HUD is displayed and the checkbox returned to the unchecked state. I couldn't find any documentation about this - what does the lock refer to? I do have quite a few locked views in my screens, am I supposed to unlock them before converting the storyboard?
For me helped "Reset Locking Controls" below "Use Autolayout" checkbox. Than conversion worked !
I see no settings at all under Size Inspector in Interface Builder, it is completely blank for my View, all labels and all buttons. I am using xcode 4.6 and have 'Use Autolayout' unchecked and the metrics (Size, Status Bar, Top Bar, Bottom Bar) are all 'None'. I need to be able to control the autoresizingmask, but why can't I see any size properties?
Once you switch to Size Inspector tab, directly under the icon there is a little header that says "View." If you hover over that some text appears that says "Show," because apparently that section can collapse down. Clicking the header should cause the options you expect to appear.
I wish they would make this more clear, because I completely missed it as well, and restarted Xcode several times.
I ran into this problem using Xcode 5.0 but upon further investigation, discovered the dysfunction ran to a higher degree - all Inspector views in Xcode were blank for every control, and the Navigator buttons didn't work either.
The culprit seems to have been a conflict in versioning. When I re-checked out trunk, Xcode returned to expected behavior.
Resizing the Xcode window made things right again for me - go figure.
This worked for me......
Clear Menu -> Recent Files
i cleared last open storyboard from Recent files
Restart Xcode
I ran into this really frustrating issue today.
I want to set my view to be autosizing like this:
But all I find in my xcode settings for an NSView is like this:
The two screenshots are taken from two different projects with the same xcode 4.3.2. Is this a bug or am I missing something?
Thanks.
Starting in Xcode 4.3 the xib files for Cocoa projects have auto layout turned on initially. When a xib file uses auto layout, there is no Autosizing section in the size inspector.
If you want to turn off auto layout, open the file inspector and deselect the Use Auto Layout checkbox.
Seaid's solution works. but i think it's bug because the auto sizing tool will apear about half a second when switching to another inspector.
Xcode 4 interface-builder problems