I have searched a lot but not able to find anything fruitful.Here is my scenario:
I am making a horizontal Image Slider(UIScrollView)
which consist of multiple images.
The slider is working fine.
But the problem arises when I implement Pinch-In Zoom-In-Out`.
I am using this delegate method to zoom a particular Image:
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return imgView;
}
Whenever I zoom-I
n any image the Image next to it changes its position and the image which I am zooming after I leave my finger the image slighly shift to left and top . It not stoping where I want to stop.
What I have Done: Programatically created image and added them to scrollView.
xPointer = 0;
for(i=0;i<[imgArr count];i++)
{
UIImageView *imgToZoom= [[UIImageView alloc]init];
imgToZoom.image = [imgArr objectAtIndex:i];
imgToZoom.tag = i+100;
imgToZoom.frame = CGRectMake(xPointer, _imagesScrollView.frame.origin.y-10, self.view.frame.size.width,_imagesScrollView.frame.size.height/2);
[imgToZoom setUserInteractionEnabled:YES];
[imgToZoom setMultipleTouchEnabled:YES];
[_imagesScrollView addSubview:imgToZoom];
xPointer = xPointer+self.view.frame.size.width;
}
_imagesScrollView.contentSize = CGSizeMake(xPointer, _imagesScrollView.frame.size.height);
How can I implement Pinch In zoom. As When I done it using apple Doc My other images are changing there position.And Zoom in also not to the point.