0

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.

David
  • 14,205
  • 20
  • 97
  • 144

1 Answers1

1

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.

Community
  • 1
  • 1
Ilanchezhian
  • 17,426
  • 1
  • 53
  • 55