Reputation: 4045
In my application i have UIIMageView within UIView, in portrait mode imageview fills whole area of UIView, but after orientation is changed UIView rotates but not stretched, though i have set content mode of UIView to Scale to fill, what is wrong?
Upvotes: 0
Views: 2625
Reputation: 1136
you can try using
imageview.frame=CGMakeRect(x, y, width, height);
in setPositionForOrientation function
Upvotes: 0
Reputation: 10005
Set the autoresizing mask:
yourUIImageViewInstance.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
read also this.
Upvotes: 1