The zoom for uiscrollview isn't working

后端 未结 3 871
别那么骄傲
别那么骄傲 2021-01-27 06:16

I don\'t understand why the scrollview isn\'t working, because I followed advices from tutorials.

I created the UIScrollView that contains an UIImageV

相关标签:
3条回答
  • 2021-01-27 06:49

    You need to return imgv in your delegate method viewForZoomingInScrollView::

    - (UIView *) viewForZoomingInScrollView:(UIScrollView *) view {
        return imgv;
    }
    
    0 讨论(0)
  • 2021-01-27 07:11

    You have to add the imageView as a subview to the scrollview

    [scrollView addSubview:imgv];
    
    0 讨论(0)
  • 2021-01-27 07:13

    I believe you are forgetting to set the frame of your imageView properly

    self.imageView.frame=CGRectMake(0, 0, self.imageView.image.size.width, self.imageView.image.size.height);
    
    0 讨论(0)
提交回复
热议问题