我想放大/缩小我的UIView
,但当我缩放视图时,我的自定义滚动视图不起作用意味着我无法滚动视图...
self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
self.scrollView.scrollEnabled = YES;
self.scrollView.minimumZoomScale=1.0;
self.scrollView.maximumZoomScale=2.0;
[self.scrollView setContentSize:CGSizeMake(self.view.frame.size.width*2, self.view.frame.size.height*2)];
self.scrollView.delegate=self;
[self.scrollView addSubview:self.view];
UITapGestureRecognizer *tripleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTripleTap:)];
[self.view addGestureRecognizer:tripleTap];
-(void)handleTripleTap:(UIGestureRecognizer *)g
{
if(self.scrollView.zoomScale > self.scrollView.minimumZoomScale)
[self.scrollView setZoomScale:self.scrollView.minimumZoomScale animated:YES];
else
[self.scrollView setZoomScale:self.scrollView.maximumZoomScale animated:YES];
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return self.view;
}
请帮帮我...
...谢谢