3
votes

I developed a project using xcode 7 and i updated my xcode to version 8.0 . According to the below steps it happens (I just wanted to show in which step this layout bug appears).

i opened my previous project and run in xcode 8 it works fine at first without opening the story board from xcode. (This is only a one view of my app).

enter image description here

And i open the story board by selecting iphone SE (new feature of xcode 8) enter image description here

i ran the project after opening the storyboard, then this view looks fine too but the storyboard view was a mess (but many other views looks messy in my iphone after opening the storyboard) storyboard view looks like thisenter image description here

according the the stack overflow researches i perform "update frames" action in storyboard to this view. after that it looks good in storyboardenter image description here

but it looks wired when run in iphone after perform "update frames"
enter image description here

is this a bug in xcode 8 or any solutions to this. this layout issue starts after opening the storyboard from xcode 8, without that it works fine in UI

3
you should check all constraints, and if you want to check view size, do it after viewDidLayoutSubviews - protuberian
I had to clear all the broken constrains and add it. Thanks for yo advice - Lahiru Pinto

3 Answers

0
votes

you can check this link :https://forums.developer.apple.com/thread/63133 it should help you a little bit , or (I have done this option in my projects) you can change the frame( of ViewController) to freeroam (600, 600) , if your view looks totally different. The final option is to make you constrains again to fit the ViewController's size(the longest but I think that the best option).

0
votes

Did you put your UI in a subview? Cause I have the exactly same problem with you, and I solved the problem by adding " self.layoutIfNeeded() " in the area which generate my subview.

Hope this help.

0
votes

This issue is resolved by Apple in xcode 8.1 please download the new xcode and try it again running on simulator or device you may get this issue resolved i have done this and it resolve my issue at once while i am now using xcode 8.1.