I have a UIView
, which contains a UIImageView
subview. The subview fills the parent view frame.
I am zooming the parent UIView
from a point in the center of the screen, from a width and height of 0, 0 up to full size.
The subview won't stretch to fill the par开发者_如何学编程ent, it just remains full size the whole way through.
I've tried various combinations of contentMode
and contentStretch
, but nothing I do seems to work.
Help gratefully received.
If by zooming
you mean animating the superviews frame, you have to set up autoresizing correctly. The superview must be set to do autoresizing:
superview.autoresizeSubviews = YES;
... while the image view must have its mask set up correctly:
imageview.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
精彩评论