2

So I've been working on an XCode Project for a while, it's practically done but there's a problem I didn't realize until it was too late. I'm working without Size Classes but with Auto Layout. I have a background image in the back and some buttons and labels over it. When I was setting the constraints for everything it all seemed to be in its place and I tested it various times in the same device size (iphone 5s) with the simulator. Now I decided to test it with the iPhone 6, and everything is wrong and not in the place I want it to be. How do I make labels/text fields/buttons keep the same size in ratio to the device?? How could I adapt things proportionally?? Please help.

Gabe12
  • 607
  • 1
  • 7
  • 25
  • Add an image of what is wrong and an image of what you expect to see. Just telling SO that something is "wrong and not in the place I want it to be" does not help. If you want to proportionally size something horizontally (for instance) set a constraint between the widths where the ratio is the proportion. The same for proportional vertical sizing. – Robotic Cat Jul 29 '15 at 01:38

2 Answers2

2

I was getting the same issue , But after some R&D found useful solution .

Have a look into given link :Set view controller in ratio for iPhone-6 and 6+

Its very easy process and working for me .

Community
  • 1
  • 1
Alok
  • 24,880
  • 6
  • 40
  • 67
0

I'm sorry for the bad explanations but I've found the way to do it. Here's the video that explained me how use constraints based on proportions and not on pixels. https://www.youtube.com/watch?v=Gl6DibzPYa4 (The first 5 minutes is basically it)

Gabe12
  • 607
  • 1
  • 7
  • 25