Properly zooming a UIScrollView that contains many subviews

后端 未结 3 963
死守一世寂寞
死守一世寂寞 2020-12-14 03:05

I created a zoomable UIScrollView and added 100 subviews to it (tiled). The view scrolls perfectly left and right. However, I\'d like to allow zooming.

To do so I re

3条回答
  •  余生分开走
    2020-12-14 03:15

    You have to return what your going to add views to scroll view as a subviews.

    Ex: If you are adding image view to scroll view then write

    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView 
    {
    return imageView object;
    }
    

提交回复
热议问题