Properly zooming a UIScrollView that contains many subviews

后端 未结 3 958
死守一世寂寞
死守一世寂寞 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:13

    I created the view where I added everything using:

    UIView *zoomableView = [[UIView alloc] init];
    

    without setting its frame.

    The problem was solved when, after adding all the subviews to it, I set its frame to something large enough to accommodate all the tiled subviews.

提交回复
热议问题