Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warnings: Misplaced View

I recently updated Xcode and I got the following warnings:

enter image description here

I tried Editor -> Resolve Auto-Layout Issues -> Clear all constraints in view controller but it did not work... I am using Xcode 5. How do I remove the warnings?

like image 308
Abdullah Shafique Avatar asked Sep 20 '13 14:09

Abdullah Shafique


2 Answers

In Xcode 5 the position of views on the canvas does not update when constraints are applied. Thus, it is possible to have constraints that specify a different position for the view than you see it in Interface Builder. You can correct this by pressing Command + Option + = or selecting "Update Frames" in the |-•-| menu (I think it looks like a tie fighter).

Update for Xcode 8: The "Update Frames" command now has its own button. It's located just to the left of the Stack View / Alignment / Constraints buttons and looks like a reload arrow surrounded by corner brackets:

Update Frames

like image 185
Josh at The Nerdery Avatar answered Sep 27 '22 23:09

Josh at The Nerdery


Select this view in Storyboard, then 'Editor -> Resolve Auto-Layout Issues -> Update All Constraints in View'

It works for me.

like image 28
folse Avatar answered Sep 27 '22 21:09

folse