I currently updated to Xcode 8 GM.
When I try to see my storyboard, above window pops up and there's no way to avoid this settings.
I chose 6s screen and all my view controllers changed to 6s size.
It will be much harder to adjust layout constraints on that small screens.
I believe it's possible to change the size to iPad but I want to know what this is first.
No way to comeback to ambiguous sized view controllers?
What is this settings for?
A way "come back to ambiguous sized" can be:
Select all the Scenes(View Controllers) in the Storyboard, show the Size inspector, change the Simulated Size to Freeform, then set Width Height = 600.
Then, those tons of warnings disappear.
In Xcode 8.1 updated version, there is a shortcut button for this.
For cases, when only updating of the Xcode fired these warnings, just select the problematic view's superview (containing mentioned constraints), and click this update frames button:
Select warning in the Scenes (View Controllers)
Select 'Update Frames'
Check 'apply to all views in the container'
Select 'Fix Misplacement'
Or
Select View in the Scenes (View Controllers) in the Storyboard
Select 'Resolve Auto Layout Issues'
Select 'All Views -> Update Frames'
Then, those warnings disappear.
Its easy to do in XCode 8.1
pedrouan answer is perfect. I am just adding the same answer in pictorial representation.
I just opened up my xib file of complex cell and its a lot of warnings; You can see in following picture:
You just need to select top level view/cell in xib hierarchy and click 'Update Frames' button; Everything will become perfect.
All warnings will gone like following screenshot:
Related
i have a problem. I had a storyboard in Xcode 6 with the inferred size of the view controller and the "Use Auto layout" option checked. Today i wanted to use the new " Use Size Classes" option. I checked the option and then in the simulator the screen was all black!
EDIT
now that i resolved this issue i have another thing here ! I use "Add missing costraints" option to have a resize for all Apple Device, the Tab bar and navigation bar are good, but then all the buttons ( they have an image ) are in different position !
How i can resolve that ? Thanks in advance.
A black view.. if not always, is a good indicative that the view is not loaded. Size Classes introduces a new concept ...You can have several views that will be installed or not into your view depending of your view configuration. More details on images below:
This is what you will be looking for:
This is what I call view rendering configuration (sure Apple has another name for it). It is located at center bottom of your storyboard view.
This is always located at the end of Attributes Inspector tab:
Make sure it is enabled for the view that suits your testing device.
I found out that the ViewController wasn't set as Initial Controller.
You should avoid as possible the use of "add missing constrains". Is an automatic tool that almost always ends up adding unnecessary constrains or breaking others.
If you want something to look really good an stable, sadly there are no shortcuts... you will eventually end having to do it all by yourself.
Does anyone know why I get the following message:
"The selected views have no constraints. At build time explicit left, top, width, and height constraints will be generated for the view."
I'm using XCode 5 - Storyboard with AutoLayout turned on
Found the solution!
Select the ViewController then from the XCode menu:
Editor --> Resolve Auto Layout issues --> Add missing constraints in View Controller
It appears that in Xcode 5.1 when using AutoLayout, when you create a new scene it will start without any editable constraints. They are generated at runtime to reflect the scene's intended layout.
So adding constraints in interface builder is not needed only if you wish to modify the defaults. When you do that you need to familiarize yourself with the provided tools (as seen in the "Resolve auto layout Issues" menu)
In a ideal wold layout just works without thinking to constraints, even if they work behind the scenes. It seems to me a step towards that goal. This is not to start a debate if the goal can be reached, only to say that we can expect more similar interface builder / xcode changes to follow.
You have selected auto layout on your viewcontroller , so you can't set the contraints manually , uncheck the layout , it will show the constraints automatically .
I have attempted to search for AutoLayout, Contraints and several other items, but I can't seem to find an easy answer to what appears to be a simple issue. Below are two screenshots. The first one is a 4" iPhone in Storyboard, the second is the 3.5".
At the bottom, I have a "UIView" that sits on top of all the other layers and will only pop-up when I hit a "share" button. See my problem? I want to maintain the same size for the UIView on both the 3.5" and 4". As you can see, it grows and doesn't look as good on the 4" screen. What settings need adjusted in order to make this happen. I know it's going to be a constraint setting.
Simply select the black top UIView, and in the IB window add a height constraint.
To do so, search for "Pin" menu in the bottom right corner of the window, and select "Pin Height".
This tells Xcode that you want your view to always keep the same height. Note that this will probably make one of the previous constraints of your view useless (in my case I deleted the "Top Space" one).
I am working with iOS6 and Xcode 4.5, I am getting an UI issue with some UIButton, some of the buttons title are not getting shown in my view.
In an older version of iOS everything works as expected.
Please see the following image. It's not showing the text "Button" while executing it on simulator
I had a similar case which I just resolved. I think I know what triggers the issue with auto-layout.
I assume that you have created one button, then copied across the row and then copied the rows down. When you do that, one of the auto-layout constraints that's set is "Baseline alignment" between the buttons.
The problem is if this constraints (it does not have to be user-level) remains between buttons which are not on the same horizontal position, meaning between buttons in different rows. So select the problematic button and check to see if you have this constraint. This was my case:
If you do, select it, upgrade to user-defined and delete it. All magically works afterwards.
1Finally i solved my issue , actually iOS6 makes a default auto layout for view controller , through that it will align each component in the view .while i dont need the auto layout .
so i just uncheck the auto layout in property which solved my issue .
clean your project and build again, if not work then restart the xcode and remove the old app from the simulator.
one thing more, if nothing work for you then remove the button and add new buttons.
Try changing the "line break" property of the button to anything other than truncate middle. It looks like it's being truncated to just an ellipsis.
I'm trying to layout a very simple view. I've placed 4 custom buttons in the view in a grid like spacing. But when I run the app I get two of the buttons with different sizes. I've included the storyboard and simulator images here.
I would LOVE to disable constraints but cant find where to do it! I really don't want them. This is just for a simple prototype app and in the end I won't even have these buttons, I'll lay everything out in code.
I've tried dragging in 4 individual buttons AND tried just dragging in one and duplicating it to where I want. I just want them to stay where I put them! Any help would be appreciated.
-Mark
You turn it off in the File Inspector (first tab on left) -- there's a checkbox called "Use Autolayout" (it's checked by default).