My app displays the views properly on iPhone 5, but on 6 and 6 Plus, the views do not fill the screen horizontally. I tried adding autoconstraints through Storyboard, but they do not make a difference.
Below are what I have in Storyboard for the blue view (and subviews), and a screenshot of the app for the Plus.
Auto Layout is a constraint-based layout system. It allows developers to create an adaptive interface that responds appropriately to changes in screen size and device orientation.
Aspect ratio constraint is used to control the width and height of a view as per a aspect ratio that you set here. There are some standard presets such as 1:1 which means width will be equal to height. Similarly other presets calculates the dimensions based on a ratio.
I have already encounter this problem. It is because of margins. You just have to uncheck Constraint to margin in Interface Builder.
And you should also check directly on the constraint (Click on it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With