0
votes

I have Create UIScrollview Programatically.I have added 5 View and each view have Imageview with image. I am doing zoom in/zoom out image using UIPanGesture i can zoom in and zoom out image using PanGesture but when i scroll the scrollview then UIImageview not set its actual frame. i want to resize subview of scrollview when scrollview scroll.

Thanks in Advance

2

2 Answers

0
votes

Set your view controller a delegate of your scrollview:

scrollview.delegate = self;

Then, implement this delegate method in your viewcontroller:

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
  // resize subview of scrollview here
}
0
votes

You need to set some object as the scrollview's delegate and then implement this method:

-(void)scrollViewDidScroll:(UIScrollView *)inScrollView

Then you can do whatever you would like with the subviews whenever the scrollview scrolls (this includes automated scrolling, not just when the user scrolls).