I made a simple screen in Xcode 7 containing a single UIImageView. Then I set its constraints (as shown in the screenshot). But Xcode still suggesting to change UIImageView's Leading and Trailing constraints. I am not sure what is it that I am doing wrong here because this kind of error did NOT happened in Xcode 6.4
Related
1I am using Xcode 11 for this project which is fully used autoresizing. Now all screens become like this. Not getting what issue it is. It's working fine in Xcode 10.
1.Try adding constrain again and works.
If point 1 does not work.
you can also set height of the view by calculating the total height of your content.
I am new in iOS and I am facing problem regarding to set constraints in Xcode 8. I have set constraints in Xcode 6.2 now I update xcode 8 and my constraint are not working.
I have tried each thing which is on net but nothing help. I have also changed Opens in "Xcode 7.x" but not work. I am using custom tableview and it shows text as in the image.
Constraint screenshot:
Select the controller size same as Xcode 6.2 in the storyboard.
I just converted my Xcode project from Xcode 7.3 to Xcode 8 GM and I am getting over 80 constraint warnings. In Xcode 7, my storyboards were "big squares" rather than a specific iPhone size. Now, with Xcode 8, you can change to the different iPhone and iPad sizes. My constraints are still showing up as they were with the more squared-off VCs in Xcode 7. Is there a "quick" fix or do I need to go through my entire app and fix each and every constraint (far more than 80)?
UPDATE: September 20,2016 -> Many bug reports have been filed based on this feed and Apple should be aware of the problem. I will update with an answer as soon as the problem is fixed.
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.
I had the same issue when updating to Xcode 8. My storyboard looked just like you describe. Check your warnings/errors. If they all say something like "set vertical hugging priority to X" or "set compression resistance to Y" then you should be able to fix your issue by setting the priorities as suggested.
Click a warning, then in the attribute inspector under the tab with the ruler icon (not sure what that tab is called) you can set the priorities under the Content Hugging Priority and Content Compression Resistance Priority headers. As you update these properties the warnings should start to change to incorrect frame warnings, at which point you can just update the frames.
This might not be a quick fix, but changing a few priorities for some constraints is easier than redoing all the constraints. I hope this helps!
Select the view controllers one by one and press "Update Frames" each time.
I wrote an app for iOS4 or iOS5. I upgraded it to iOS6. Adding the new constraints were rather traumatic (I had to almost completely redo the Storyboard and I had to create a bunch of constraints since they didn't exist before), but I got through it. Now I'm upgrading to iOS8 using XCode 6.4. I have written other apps in iOS8 and the constraint icons are always on the bottom; there are 3 of them: Align, Pin, and Resolve Auto-Layout. However, in this older app, all of these icons are missing (also the W Any H Any in the middle is missing as well). One of the constraints is wrong, but I can't fix it because I don't have any constraint icons. How do I get them back?
Here is a new app that shows the constraint icons:
Here is the old app with the constraint icons missing:
Select the storyboard (on the left) and the File inspector (on the right; not present in your screen shots, you'll have to show it deliberately). The File inspector has a Use Auto Layout checkbox. If the storyboard doesn't use auto layout, you won't see those constraint icons.
If the autolayout checkbox is not available, quiting Xcode and reopening worked for me.
In summary, without height specified on a subview, adding constraint causes Xcode to hang.
I am using Xcode 6.3 (6D570) on Macbook Air with OSX 10.10.3, and am currently experiencing a very strange problem. I have an .xib file, which contains a view and a scroll view. Very simple, really. Here's my current setup:
Notice that the light blue/green section downwards are contained in a scroll view. In the interface builder, the bright red section does not have constraints set yet. When I try to add, for example, a vertical space constraint to the lightgray view above it, Xcode hangs.
When Xcode hangs, the Size inspector tab becomes empty and the mouse starts spinning endlessly. Here's the Size inspector screenshot when the hang happens:
After spending almost half a day, I managed to single out the problem. This problem does not happen if I add the constraints via Pin button on the bottom right corner, and specifying the height constraint of the view.
Adding constraints only work as expected if I specify / add a height constraint first. This also happens when I try to delete a constraint, for example, top space to container constraint from a label (that does not have a height constraint). I can add them just fine, but when I try to remove a constraint or delete the view, Xcode hangs.
Oh, to add more confusion: this happens frequently. As in 7 hangs out of 10.
Things I have tried:
Remaking the view on different file
Remaking the view on different project
Closing all applications except Xcode, including iOS Simulator
Restarting my computer
Things I have not tried:
Reinstalling Xcode (or rolling back to previous version).
Should I just delete Xcode and install (download) fresh? Is this possibly a bug from the new Xcode?
It seems there's a bug within Xcode 6.3.0. There's an update to 6.3.1 Apr 21, 2015 that should fix this issue: