UIScrollView无法使用自动布局放大iOS7

时间:2015-11-11 07:52:15

标签: ios objective-c uiscrollview autolayout

我创建了一个具有此层次结构的UIScrollView(我的示例是AutoLayout)

UIViewController
  UIView
     UIScollView
       ContainerView
          UIImageView

enter image description here

iOS 8中的一切正常 - 期望 iOS 7

我可以在iOS 7中缩放我的ImageView

我已实施:

-(void)viewDidLayoutSubviews
 {
[super viewDidLayoutSubviews];
CGSize scrollableSize =  CGSizeMake(self.imageView.frame.size.width,self.imageView.frame.size.height);
[self.scrollView setContentSize:scrollableSize];
self.scrollView.backgroundColor = [UIColor whiteColor]; 
self.scrollView.minimumZoomScale = 1.0  ;
self.scrollView.maximumZoomScale = 4;

  }



-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
 return self.containerView;
}

我已查看此链接: UIScrollView zooming with Auto Layout Scroll View not functioning IOS 7

问题

缩放在iOS 7中不起作用,(我需要使用自动布局),我的UIImageview应该有AspectFit比率

我在github上传了我的样本:

sampleProject

0 个答案:

没有答案