开发者

How to make a parent view autoresize based on subview for iPhone?

开发者 https://www.devze.com 2023-03-23 05:32 出处:网络
I have a UIScrollView and a开发者_如何转开发 subview in it. I would like to swap subviews and have the scroll view automatically resize its content view to the size of the subview.

I have a UIScrollView and a开发者_如何转开发 subview in it. I would like to swap subviews and have the scroll view automatically resize its content view to the size of the subview.

Any suggestions on how I may do this? Thanks.


add -(void)layoutSubviews to your class. Whenever u swap the subviews, this would get called. There you take the size of the subview and you can set the content size of the scrollview.

Not exact reference. But u can know something from here.

0

精彩评论

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