Welcome to the Treehouse Community
Looking to learn something new?
Ilya Feynberg2,567 Points
Completely lost on autolayout, constraints and screen designs. :(
I'm a bit stuck and any help would be greatly appreciated!
I'll give you a quick overview. I have designs for a screen that were built in sketch using an iphone 6 screen size, then redesigned to fit and look right for an iphone 5/5s/5c, and 6 plus as those are the only devices that I want to support.
But the design portion or implementing the designs for just one specific screen size is easy and I understand that part. Where am I'm lost completely, is how to implement a design in one view controller that looks the way that it should in all the screen sizes I designed for.
I've gone through more than a few auto layout and size class tutorials both here and elsewhere and not sure how I properly use them so that the app recognizes "this is an iphone 5, use these image sizing and placements instead, and this is an iphone 6 plus, use these" and so on.
Everything I've seen to this point regarding auto layout and constraints only use 1 set of numbers to judge distance from elements for example, but all screen sizes would have different distances.
What am I missing or not understanding? I know I'm looking at something improperly.
Thanks in advance for all help!
I may be wrong, but as far as I know, there isn't a way to use different values based on which model iPhone is running the app. It's a trick of using relative values (such as percents) rather than absolute values, and just tweaking those relative values so that they gel convincingly on all screen sizes.
In short, I think it's just a balancing act. Like I said, I'm not totally certain this is the case, but I haven't seen anything suggesting the contrary so far.