Reputation: 514
I am using Auto layout in xib files and not using Storyboard
.
I have added one UIImageView
on self.view. I am trying to set the aspect ratio on UIImageView
width and super view height. But when I drag the control from UIImageView
( subview) to self.view (superview) to enable the aspect ratio option but I am surprised that aspect ratio option is not coming.
Only four option are coming
How to set the aspect ratio between subview and superview.
Thanks in Advance.
Upvotes: 1
Views: 4172
Reputation: 154513
I'm not sure why XIBs don't allow you to set Aspect Ratio constraints at the top level. Here is a workaround:
Upvotes: 1
Reputation: 26
Emulating aspect-fit behaviour using AutoLayout constraints in Xcode 6
Excellent and simple explanation (with images!) that just might help you solve the problem. Hope this helps...
Upvotes: 1