Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missplaced views every time i open the storyboard

Tags:

ios

autolayout

I'm using a storyboard with some ViewControllers that have elements positioned with autolayout. Every time i open the storyboard, i get misplaced views even after i fix all of them. I have to update the frames time and time again. Is there any way to fix this? I'm using xcode 6.

like image 916
Dănuț Mihai Florian Avatar asked Oct 14 '14 07:10

Dănuț Mihai Florian


Video Answer


1 Answers

As @Anil Varghese pointed out the problem is the size of the view. Anything other than wAny hAny will trigger this warning when opening the storyboard file. I think it's an Xcode bug. enter image description here

So I had to make sure that my views are set up like in the picture above. This means designing for all sizes, so, in my case, my UI got all messed up and i had to redesign it. But it was for the best!

When you change to wAny hAny you view elements will become invisible because they are bound to other size classes (like wCompact hAny). You need to delete those rules from the Attributes inspector.

like image 181
Dănuț Mihai Florian Avatar answered Sep 22 '22 00:09

Dănuț Mihai Florian