Reputation: 388
I want to align my images in UIImageview to the left. I am using Aspect fit mode. How can i achieve the goal using autoresiging constraints.
What i have done is as
I want to align this little logo to the left.
Is there any way to set it using constraints and struts. I want like this
Upvotes: 1
Views: 631
Reputation: 388
I have done it programmatically. But still to head to set these constraints using ui-builder. If anyone know please share your knowledge with us.
CGFloat desiredHeight = .20 * self.logoImagesContainer.frame.size.height;
CGFloat scaleFactor = image.size.height/desiredHeight;
CGFloat desiredWidth = image.size.width / scaleFactor;
self.logoImageView.frame = CGRectMake(0, 0, desiredWidth, desiredHeight);
Upvotes: 1