CarlHere
CarlHere

Reputation: 43

Autolayout views always same size on different screen sizes

I have a view: View

Can someone help me to layout these views that they all look the same on every iPhone? I mean size is dynamic and views shrink according to screen size.

I have tried aspect ration and other layout options but none helped.

Upvotes: 1

Views: 2894

Answers (2)

Dhaivat Vyas
Dhaivat Vyas

Reputation: 2928

As per your question please look at the link below it might help solving your problem of multiple views size and layout.

https://stackoverflow.com/a/27471120/4101371

you can also refer:

https://www.youtube.com/watch?v=Nl2iMF0yKW8&list=PLXCowKcXAVgrxHKLWTa4HxNPrSmTj3D-_

I've also added this link in the answer in above answer.

Upvotes: 1

Bhubala.k
Bhubala.k

Reputation: 21

if you want to change the view sizes on different screens using auto layout ,you have to add the height and width constraints .then only it changes view size.

Steps:

  1. open your project in xcode.

  2. goto storyboard choose Auto layout ,select your view ,

  3. in Xcode From the Editor menu, choose Pin\Width and Height both

    http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1

Upvotes: 2

Related Questions