缩小 UIscrollview 的内容

Zooming out from content of UIscrollview

我曾经使用这两行来缩小滚动视图的内容。但是自从 iOS8,我不能再缩小了。它什么都不做。

谁能给我解释一下为什么。我关闭了自动布局。

  [scrollView setZoomScale:0.3 animated:YES];
  scrollView.contentSize = CGSizeMake(tempSize.width*0.3, tempSize.height*0.3);

我不确定这是否对您有帮助,但是这种方法在放大时对我有用 iOS 8. 在这段代码中,滚动视图中有一个 imageView。

- (void)viewDidLoad {
[super viewDidLoad];

self.scrollView.minimumZoomScale = 0.5;
self.scrollView.maximumZoomScale = 6.0;
self.scrollView.contentSize = self.PhotoView.frame.size;
self.scrollView.delegate = self;
}


- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return self.PhotoView;
}
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView*)view atScale:(CGFloat)scale{
}