I have a UIScrollView page that contains various kinds of information, such as UITables, but also scalable images. So I set up main-ScrollView with the ability to view pages, and as subzones I added ScrollViews scalable images with images as content. Everything works fine, I just can’t set a smaller current scale scale for ScrollViews images.
UIImageView *imageView = [[UIImageView alloc] initWithImage:Image];
[imagelinkArray addObject:imageView];
CGRect ScrollViewImageRect;
ScrollViewImageRect = CGRectMake((self.scrollView.frame.size.width) * i, 0, 320, self.scrollView.frame.size.height);
float widthfactor = ScrollViewImageRect.size.width / imageView.frame.size.width;
float heightfactor = ScrollViewImageRect.size.height / imageView.frame.size.height;
float zoomscale = MIN(widthfactor, heightfactor);
UIScrollView *imageScrollView = [[UIScrollView alloc] initWithFrame:ScrollViewImageRect];
imageScrollView.contentSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height);
imageScrollView.delegate = self;
[imageScrollView setMinimumZoomScale:zoomscale];
[imageScrollView setMaximumZoomScale:1.5];
[imageScrollView addSubview:imageView];
[imageScrollView setZoomScale:0.5 animated:YES];
[self.scrollView addSubview:imageScrollView];
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return [imagelinkArray objectAtIndex:page];
}
ScrollView Image-ScrollViews , . . , , . -ScrollView 1.0, .
, :
[changeScrollView setZoomScale:changeScrollView.minimumZoomScale animated:YES]
, 1.0;
, , - - (void)scrollViewDidScroll:, , , , , . , - . , UIScrollView , . ?
Update:
. , , , "-" ScrollViews ScrollView. ScrollViews, ( ScrollView, ALL sub-ScrollViews).
?