Rony Rozen
Rony Rozen

Reputation: 4047

UIView autoresize problem

I have a UIView with several subviews: one UIImageView and a couple of UIViews. When I change the frame property of the view, the imageView's size changes accordingly, but the rest of the subviews remain in their original size!

I can't figure out what I'm doing wrong. Can anybody help?

Thanks,

Upvotes: 0

Views: 1286

Answers (2)

M Penades
M Penades

Reputation: 1592

First make sure autoresizesSubviews property of uiview is true.

If that does not work you can resize all subviews by "hand":

for (UIView *m_subview in [uiview subviews]) {
        m_subview.frame = newSizeFrame;
        }

Upvotes: 0

Jordan
Jordan

Reputation: 21760

Check Autoresizing in IB or code for each of your views.

Upvotes: 1

Related Questions