I'm currently working on an iPhone app for a local non-profit that I'd like to have be at least reasonably compatible with the iPhone 6 upon release. As this is my first mobile app I'm obviously new to Auto Layout and experiencing some issues with making use of it.
At the top of several of the Views in the app I have a header made from an Image View that's nested inside of a colored sub-view. I've used Auto Layout to ensure that the image view will always have the same distance from the edges of the sub-view and it seems happy with that - blue lines all around in the Storyboard. I'd like the image to maintain its aspect ratio, however, as it looks quite peculiar when that changes, so I've set a constraint on the image view to maintain its aspect ratio. This causes the image view to resize itself to its native resolution, which is huge and totally inappropriate for a 3.5- or 4-inch screen. Introducing a concrete width or height constraint fixes this problem but means that the image will never resize, as one of its dimensions is locked along with its aspect ratio.
How on Earth would one go about ensuring that the image can be resized with the screen while maintaining its aspect ratio? I appreciate any insights that anyone can offer.
At the top of several of the Views in the app I have a header made from an Image View that's nested inside of a colored sub-view. I've used Auto Layout to ensure that the image view will always have the same distance from the edges of the sub-view and it seems happy with that - blue lines all around in the Storyboard. I'd like the image to maintain its aspect ratio, however, as it looks quite peculiar when that changes, so I've set a constraint on the image view to maintain its aspect ratio. This causes the image view to resize itself to its native resolution, which is huge and totally inappropriate for a 3.5- or 4-inch screen. Introducing a concrete width or height constraint fixes this problem but means that the image will never resize, as one of its dimensions is locked along with its aspect ratio.
How on Earth would one go about ensuring that the image can be resized with the screen while maintaining its aspect ratio? I appreciate any insights that anyone can offer.