Springs and struts or autosizing - xcode

-RE-EDIT-
An edit was just approved on this post as it "fixed grammer[sic] and clarified the question".
In actuality, it made both worse so I've changed it back.
-EDIT-
I have a storyboard layout like this:
If I use auto layout, I get this in the simulator:
If I switch it off, and use this setting:
I get this:
Which is as close to the desired layout as I could manage with trial and error.
Anyone offer any tips on how how set it so it matches the storyboard?

Related

Storyboard issue with Xcode 6 and 7

Why my Main Storyboard appears like shown at Above? I made a copy of the project but now both of them have the same problem with the storyboard! I can run the app using the simulator and it works fine, but I can't see any labels or the buttons.
The problem is with your device layout....
Actually it makes on other layout like wAny hAny and now you show it on other layouts like wCompact hRegular....thats why the problem occurs...
Here is the visual site of it....
To prevent this type of things...you need to give constraints to your objects..after making correct constraints, the size classes won't matter that much except adaptive layout
Its because of Auto Layout Stuff. Set proper auto layout to you label object.
For eg.
Set Leading,Trailing,Top & Bottom layout to your label & then run your application. You will be able to see it on your screen.

Xcode 6.1.1 Storyboard changes layout when I re-open the project

When I open xcode and create layout everything looks pretty much like it should (meaning that the storyboard view controller looks pretty much like the preview)
But when I close out of xcode and re-open it... the view looks like this. This is concerning not just because its difficult to work on, but also because it seems that the storyboard file knows these aren't where they should be. If I click on any individual element it is looking for me to update the constraints for this new layout which is completely inaccurate.
I've tried moving all the items back to the middle, and re-laying out the whole thing, but this takes about 5+ minutes each time I want to make a change. I'm wondering if there is a way to reset the storyboard back to what it should be, or if there is some setting that I have wrong which would result in this change. Any help would be greatly appreciated!
UPDATE!
Ok so I discovered now that I can "Update Frame" to fix the layout. Still not sure why the layout is getting messed up in the first place.
That seems like a bug in xCode 6.1.x (prior to v6.3.xx), which was resolved in a meanwhile.
Here is the official reference :
http://adcdownload.apple.com//Developer_Tools/Xcode_6.3_beta/Xcode_6.3_beta_Release_Notes.pdf
Definite solution of this problem :
You need to update xCode to v6.3 which successfully resolves this problem

Suppress constraint and layout warnings in Xcode 5

I'm trying to have custom constraints for objects in my storyboard but I get a bunch of warnings that say
Misplaced View Frame for "Some object" will be different at run time.
or
Ambiguous Layout: Width and horizontal position are ambiguous for "Some object"
The problems is that if I let Xcode resolve them it will mess up the custom constraints I've set up. The recommended constrains make the layout look bizarre. So how can I suppress these warnings because I'm trying to do something very customized?
Ok guys I've solved the problem. I was pretty new to autolayout so it was very frustrating trying to learn it by trial and error.
I solved it by reading this awesome autolayout Xcode 5 tutorial and adding the necessary constraints.
If anyone else is having problems with constraints I can't reccomend the tutorial enough.
If you'd like to disable storyboard warnings altogether, go to your project build settings and set "Interface Builder Storyboard Compiler - Options" -> "Show Warnings" to "No."

Adding Custom Objects in Xcode 4.3

I'm working with Objective-C and Xcode for about a year. I customise a lot of generic objects. Few days ago one of my friend asked me a question, but I couldn't answer him. So I try to do something my self. For example:
I created this Custom View:
How can I add this View to the Object Library?. Here:
I don't really know why do I need this. But I decide to figure out how to do this. I hope you could help me with this.
Thanks in advance!
I don't think this will work. You are putting buttons on "top" of a custom view placeholder. The custom view placeholder is used to be able to use - yeah you guessed right - custom user defined views.
So of which class would your view-with-5-buttons-on-top be? I think you are running into a dead end, because that's just not the way to do it in Xcode. If you want to design your custom view graphically, just create a NIB file for it.
I don't think that you can add your own view objects into the object library. Everything I know of are user-defined code snippets which will show up on the right.
Edit
There were things called IB plugins in Interface Builder and Xcode versions prior to 4.
Those were discontinued in Xcode 4 as can be read here for example :
http://xcodebook.com/2011/03/no-interface-builder-plugin-support-in-xcode-4/
Further searches for IB plugin gives a lot more guys telling the same.
Best,
Flo

Xcode stupid warning: View is clipping its content

I get this stupid warning in Xcode 4
Clipped Content
View is clipping its content
if I create an unbordered bevel button with an image bigger then the button itself.
Why? How can i suppress it?
I had a similar problem with a gray warning.
"Warning: Clipped Content. View is clipping its content in
XXXX.xib"
I got rid of the warning by right clicking on XXXX.xib > Open As > Source Code.
After building again in xcode the warning was gone.
Change scaling according to your requirement. It will solve it.
as far as i know you can't suppress specific xib notices, but you can disable them in general. in project->settings (or target->settings if you have multiple targets and only want to do it for one/some), there is the "Interface Builder XIB Compiler - Options" section which includes "Show Notices". if you set this to No then you should stop seeing this message. of course, it may mean you miss out on other messages.
I had the same problem and I finally ended up resizing the image because it was so annoying.
Had the same problem. Nothing helps, but add the complaining NSButton again, same wires and bindings and image in same size (scaling down), problem was gone.
For Xcode 10.2.1 what solved my problem was to choose Position Below, on Interface Builder, as shown in these pictures, under Show the Attributes inspector tab:

Resources