I want to center an UIView
containing a UIImageView
in an other UIView
both horizontally and vertically.
So i placed all Items in Interface Builder and set Constraints for center vertically and horizontally. Then i added max height and width to avoid the inner UIView
excessing the outer UIView
.
But still Interface Builder tells me I need to specify X and Y Constraint for the inner UIView
.
What did i do wrong?
Reason i'm needing this is, i need a UIImage
which can be landscape or portrait format displayed centered in the UIView
. Also there should be an Icon overlaying the UIImage
in the lower right corner. So i thought best solution would be to make a UIView
containing both images and place it centered in the main uiview. But it seems autolayout won't let me do this.
Can somebody hint me in the right direction please?
EDIT
For more Clarification on what i want.
I need a UIView having its Center Point fixed at exaclty one point in its superview. How can i do this with maintaining flexible height and width and using autolayout?