z22
z22

Reputation: 10083

iOS: autolayout move view from left to top right

I have 3 views and I wish to handle their layouts using autolayout constraints. Portrait is like this:

enter image description here

and landscape should be as follows:

enter image description here

How do I do this using autolayout? I tried adding constraints, but the 3rd view(in green color), doesn't move up. It moves on the right side though.

Where am I getting wrong? How do I solve it?

Upvotes: 2

Views: 645

Answers (1)

Yatheesha
Yatheesha

Reputation: 10432

It can be easily done using Size Classes , take a look at apple doc Size Classes design help

This feature available only in xCode 6 New Features in xCode 6.

Constraints in w**Any** h**Any** layout

Constraints in w**Any** h**Compact** layout

Keep the same Constraints for other layouts.

Note that Gray coloured constraints are not installed for present layout.

You can find the sample in the link DownLoad Sample

Upvotes: 3

Related Questions