MuhammadTalhaSiddiqui
MuhammadTalhaSiddiqui

Reputation: 103

iOS Auto Layout and constraint issue

I have built ios app layout on compact width and regular height because of the initial requirement of client but now the requirement has changed and he wants to deploy app on iphone and ipad both. So is it possible to update my constraint to any width and any height from compact width and regular height?

Upvotes: 0

Views: 310

Answers (3)

j.f.
j.f.

Reputation: 3949

To explain what krishnanunni is saying in a little more depth, what you need to do is first select the constraints you want to change. You can select multiple by shift clicking or command clicking them.

enter image description here

Then on the attributes or size inspector, you should see that the constraint is currently only installed for compact width, regular height (wC hR).

enter image description here

You need to check the checkbox that doesn't list a specific size class because that refers to any width, any height. After that, there is no longer a need for the compact width, regular height constraint so you can delete it.

enter image description here

Upvotes: 1

Usama
Usama

Reputation: 1965

All your constraints would be placed for size class compact width and regular height, if you click on any of the constraint it would show you constraint installed on size class compact width and regular height as shown below

enter image description here

just uncheck (or click on small cross) with wC hR and check upper box (which is for wAny hAny size class)

you will have to do that for all constraints

Upvotes: 2

krishnanunni
krishnanunni

Reputation: 510

You can install the same constraints in any-any.

enter image description here

Upvotes: 3

Related Questions