Romejanic Romejanic - 1 year ago 85
iOS Question

Multiple View Controllers - iOS 7

I am try to develop an application involving text views. If I use the 4 inch size, it goes out of the screen on 3.5 inch devices. If I change the size to 3.5 inch, fix it and change it back to 4 inch, there is this big, ugly gap above the text view.

I think the solution to this problem is multiple view controllers. One for the 3.5 inch and one for the 4 inch. But how would I do this? I am using Xcode 5, developing for iOS 7 and testing on an iPhone 4.


Answer Source

You dont have to use two view controllers. All you need are some Auto Layout Constraints or autosizing mask to resize your view for different screen sizes. Below are some helpful links.

Tutorial about auto layouts:

Part 1:

Part 2:

Working with Constraints in Interface Builder

Apple Auto Layout Guide

A similar question about how to set auto layout constraints for 4 and 3.5 inches screens Resize view with Auto Layout between 3.5 and 4 inch form factor

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download