Warnings: Misplaced View

Abdullah Shafique picture Abdullah Shafique · Sep 20, 2013 · Viewed 26.8k times · Source

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?

Answer

Josh at The Nerdery picture Josh at The Nerdery · Sep 20, 2013

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