UIScrollView에 3 * UIImageView가 포함되어 있습니다. 각 UIImageView에는 이미지가 있습니다. 코드는 내가 사용 :UIScrollView + UIImageView 확대/축소
scrollView.delegate = self;
[self.scrollView setBackgroundColor:[UIColor blackColor]];
[scrollView setCanCancelContentTouches:NO];
scrollView.maximumZoomScale = 4.0;
scrollView.minimumZoomScale = 0.75;
scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
scrollView.clipsToBounds = YES;
scrollView.scrollEnabled = YES;
scrollView.pagingEnabled = YES;
NSUInteger nimages = 0;
CGFloat cx = 0;
for (; ; nimages++) {
NSString *imageName = [NSString stringWithFormat:@"%d.jpg", (nimages + 1)];
UIImage *image = [UIImage imageNamed:imageName];
if (image == nil) {
break;
}
imageView = [[UIImageView alloc] initWithImage:image];
CGRect rect = imageView.frame;
rect.size.height = image.size.height;
rect.size.width = image.size.width;
rect.origin.x = ((scrollView.frame.size.width - image.size.width)/2) + cx;
rect.origin.y = ((scrollView.frame.size.height - image.size.height)/2);
[imageView setFrame:CGRectMake(cx, 0, self.view.frame.size.width, self.view.frame.size.height)];
[scrollView addSubview:imageView];
[imageView release];
cx += scrollView.frame.size.width;
}
[scrollView setContentSize:CGSizeMake(cx, [scrollView bounds].size.height)];
어떻게있는 ScrollView 줌-수 사용하여 멀티 터치를 할 수 있습니까? 이 코드 사용 :
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return imageView;
}
을하지만있는 ScrollView 여러 이미지가 포함되어 있기 때문에, 제대로, 이미지가 겹쳐있어 작동하지 않았다.
어떻게 해결할 수 있습니까? 감사
파단되지 파단 근무를) – Bejil