Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7: Misplaced View Frame for "Label - Label" will be different at run time

I just finished an app on iOS 6 and bought a developer account a week ago so haven't had much time playing with the iOS 7 SDK. Just downloaded the Golden Master version and trying to upgrade my app to be compatible with iOS 7.

I received a lot of warnings saying

Misplaced View Frame for "Label - Label" will be different at run time.

and I am unable to run the program. The project contains tableview and its is parsing and displaying XML feed from an RSS.

How to fix this issue?

like image 579
AJ112 Avatar asked Sep 12 '13 07:09

AJ112


1 Answers

The accepted answer will fix the problem, but that's not a good solution because it'll remove all your constraints. If you have spent hours on the constraints then don't do that.

If you click the triangle next to the warning you can get the explanation of what is misplaced. Then you can just move the frame to where it's supposed to be. For example:

enter image description here

In this case I just moved my Text View's y position to 94 and the warning will go away. This is because one of my constraints will force the view to be somewhere else when the app is running, but the position is different than where it currently is in the storyboard.


Another way to move the frame to the right position is to click on the warning next to the View Controller name in your storyboard, and then click on the yellow warning sign, and click update frame.

enter image description here

enter image description here

These two methods are not destructive and will not remove your constraints. If anything it'll show that you may need to do minor readjustments in your constraints.

like image 93
Enrico Susatyo Avatar answered Sep 19 '22 16:09

Enrico Susatyo