iProgram
iProgram

Reputation: 6577

Storyboards not showing correct layout on iOS application

I am trying to make my own iOS application for the iPhone 5, I have added 3 labels and one button, problem is one button shows up, however the one of the other buttons and the label are cropped ever so slightly and the last button is out of sight.

I know this is to make it so developers only need to design one GUI for all devices, however I don't know how to fix this.

Example error:

StoryBoard Design

enter image description here

Running on iPhone 5 simulator

enter image description here

How would I fix this?

Upvotes: 0

Views: 1113

Answers (2)

Bhavin Ramani
Bhavin Ramani

Reputation: 3219

As you said in your question that you are making an app for iPhone5. So,you have to change your view controller screen size in attribute inspector.

1. select your view controller and change size

enter image description here

2. Now your view controller looks like this

enter image description here

Now run project in iPhone 5 simulator.

Upvotes: 3

Tal Zion
Tal Zion

Reputation: 6526

It looks like you have mis-used constraints, see below a few solutions on Auto Layout:

Step 1: You can change the base value depending on the view you are working on.

Choose the base device you are working on

Step 2: Load the assistant editor

Assistant Editor

Step 3: Bring up the preview mode where you can see how each devise is looking when launching the app.

Preview Mode

Step 4: Choose which device you would like to work on.

Preview mode

Click the plus button to choose the devices

Choose Devices

Step 5: Add constraints

You can also refer to Apples Auto Layout Doc for more information and examples.

Without constraints

Adding constraints 1

Adding constraints 2

Seeing the results

Upvotes: 2

Related Questions