Siddhesh damble
Siddhesh damble

Reputation: 94

Specify Different width to 'View' for iPhone and iPad Xcode 9

I have one 'View' for which i didn't add any width and it works fine in different iPhone Sizes as i have specified aspect ratio, but as i switch to iPad that 'View' stretches to take whole space in iPad i want to specify width for 'View' in iPad, has anyone done this things before ?

Upvotes: 0

Views: 770

Answers (1)

Shehata Gamal
Shehata Gamal

Reputation: 100549

You need to disable the aspect ratio constraint for IPad and create a suitable one for it like this

1- Un install the aspect ratio constraint , click the + icon near installed from the popup select Regular for width and height , then click add variation

enter image description here

2- And un Check it for RR

enter image description here

3- Select any IPad device in the bottom Bar , click vary for traits and make the new aspect ratio constraint as you want then click Done varying enter image description here

By this you have 2 different constraints for the aspect ratio when you run the app in IPhone or Ipad , Note: you can do it for any constraint you want

Upvotes: 1

Related Questions