Reputation:
This must be a dumb question, but nevertheless I ask it. I don't have to explain (I think) that I'm just beginning with Xcode.
I have created this view in IB:
And this is the result in the simulator:
What can I do to fix this. It doesn't matter what device I choose (eg. 4S or 6) and device options are in sync (= same in IB and simulator).
NB: It is a new project and I have reset the auto-layout constraint to suggested settings.
Upvotes: 0
Views: 1407
Reputation: 2770
You need to ensure your Auto Layout constrains are accurate.
Auto Layout tip: name your items in the document outline (the left in IB). Then when you examine constraints, you will be able to see which ones they are attached to by looking in the size inspector in the right.
Upvotes: 2
Reputation: 744
You need to go into attributes inspector for the view controller (right sided panel) go Simulated Metrics(should be at the top) -> Size and change it to "iPhone 4S" or "iPhone 5".
Upvotes: 0
Reputation: 1412
Your problem is that you are not using Autolayout functionality. I Would recommend reading about it, especially if you are new to iOS Dev. You really can do a lot if you are using IB (Storyboards) - check out this tutorial is should get you started
Autolayout is a system that helps you create apps for all different device dimensions.
Upvotes: 0
Reputation: 1097
Watch this video and get familiar with Auto-Layout. https://www.youtube.com/watch?v=G53PuA_TlXk
Letting Xcode use "suggested constraints" is nearly always useless and won't work like you expect. So you'll either need to position all of your elements programmatically by changing their frame, or, you need to set up proper auto-layout constraints.
Upvotes: 1