Reputation: 201
I am learning to use constraints in Interface Builder and have tried messing around with aspect ratio and width/height properties of UIImageViews. I was just curious if there was anyway to autoresize, sort of like "zoom" to prevent a lot of white space in bigger iPhones? (6 & 6Plus).
Example of what I mean:
Notice the bigger devices have a lot of white space, would be nice to simply resize that UIImageView up top along with label based on device, sort of like I did with that bottom button by using aspect ratio. Any ideas?
Upvotes: 0
Views: 2587
Reputation: 677
With IOS 8 apple introduced size classes as an addition to auto layout. https://developer.apple.com/library/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/EnablingAdaptiveSizeDesign.html
With size classes you can have different user interfaces for different devices and different device orientations.
For The case you are describing (dynamically resizing of Views), you can also just go with the "old" basic auto layout functionality:
Tadaaa, you have an dynamically resizing Image that will always keep its aspect ration.
Upvotes: 1