我正在尝试将 UIImageView 放大UIScrollView
。我有这个:
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return imageView;
}
-(void)scrollViewDidZoom:(UIScrollView *)scrollView {
[imageView setCenter:CGPointMake(scrollView.center.x, scrollView.center.y)];
}
-(void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
}
问题是:当我缩小图像时,它居中,但是当我放大时,图像移动到左上角。
我的代码哪里有问题?