开发者

UIView autoresize problem

开发者 https://www.devze.com 2022-12-31 05:47 出处:网络
I have a UIView with several subviews: one UIImageView and a couple of UIViews. When I ch开发者_JAVA技巧ange the frame property of the view, the imageView\'s size changes accordingly, but the rest of

I have a UIView with several subviews: one UIImageView and a couple of UIViews. When I ch开发者_JAVA技巧ange 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,


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


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;
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消