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.
精彩评论