Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storyboard Preview do not match simulator or device in xCode 6

I have been trying to figure this out for a long time now, either I am stupid, or Apple hav just made this really tricky. Storyboard Preview do not match simulator or device in xCode 6! I have added constraints so that the app looks just fine in all screen sizes in preview but it looks messed up when I run it in the simulator or on my device. help!

do you need any screenshots to answer my question?

I know other people have had the same issue but I can not find any answers.

my project, everything looks just fine

the simulator does not look fine (this happens when I run the app on my phone as well, and it happens to all screen sizes in the simulator as well)

like image 995
b3rge Avatar asked Oct 04 '14 19:10

b3rge


People also ask

How do I show simulator in Xcode?

The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators. Here you can create and manage all available simulators.

How do I add a simulator device to Xcode?

Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download. When a simulator is opened from AppStudio, AppStudio Player automatically installs (if necessary) and opens in it.

How do I show Storyboard in Xcode?

To get this, open the storyboard, click the 'assistant' editor, click the 'assistant editor menu button' (immediately to the right of the > arrow at the top left of the assistant window) and select Preview.


2 Answers

The storyboard "Preview" doesn't match the simulator if you have any constraint errors/conflicts. I was having this problem, and found this question while searching for an answer. Once I got all of the conflicts resolved, the Preview worked. It seems like the preview should consistently show what the simulator would show to help during the setup, but it's all out of whack if there are conflicts.

like image 177
Justin Lewis Avatar answered Oct 01 '22 03:10

Justin Lewis


Using Xcode 6.3.1 and I was having the same problem(s). What I discovered is that you are missing constraints... open main.storyboard in your "Structure" column you should see some red arrows, single click them and you should see what constraints you are missing.

like image 30
user1045302 Avatar answered Oct 01 '22 03:10

user1045302