i am newBie in iOS Development.i make an ScrollView it contain my JSOn Array Images and my Scrollview have Paging is Enabled and i add a method for Scrollview to zoom viewForZoomingInScrollView then it is zoom my First image and Overlapped on Second image i want to zoom only my Selected image when viewForZoomingInScrollView method Called here my Code for Scrollview and For viewForZoomingInScrollView method is
Code for Scrollview to add images
for( index=0; index < [self.imagesa count]; index++)
{
NSDictionary *dict=[self.imagesa objectAtIndex:index];
NSString *image=[dict valueForKey:@"link"];
bigImage=[[UIImageView alloc]init];
bigImage.userInteractionEnabled=TRUE;
bigImage.image=nil;
bigImage.bounds=CGRectMake(0, 0, self.zoomScroll.frame.size.width, self.zoomScroll.frame.size.height);
bigImage.frame=CGRectMake(index * self.zoomScroll.frame.size.width, 0, self.zoomScroll.frame.size.width, self.zoomScroll.frame.size.height);
[bigImage setMultipleTouchEnabled:YES];
[bigImage removeFromSuperview];
[bigImage sd_setImageWithURL:[NSURL URLWithString:image] placeholderImage:[UIImage imageNamed:@"1.png"]];
[bigImage setUserInteractionEnabled:TRUE];
[self.objectarray insertObject:bigImage atIndex:index];
[self.zoomScroll addSubview:bigImage];
self.zoomScroll.clipsToBounds=YES;
[self.zoomScroll addSubview:[self.objectarray objectAtIndex:index]];
}
[self.zoomScroll addSubview:bigImage];
Here self.imagesa is Json Parsed array and self.imagearray is NSMuttable array.
And Zooming Method
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
for (index=0 ; index <[self.imageArray count]; index ++)
{
return [self.zoomScroll.subviews objectAtIndex:index];
}
return nil;
}
But it is Not Working As Right it is zoom Only First Image and When Zoom First Image and I scroll My Scrollview then Second Image is Overlaped. and here i also Set Maximum and Minimum Scale for Scrollview.And when i ZoomScrollview then its Size is Change and Only Show First image and Not Scroll.