content size of UIScrollView

后端 未结 1 1408
执笔经年
执笔经年 2021-01-20 20:51

I have a UIScrollView in which I\'ve set the contentSize to the size of the screen initially. So does this mean that if I have an UIImageView

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-20 21:38

    The zoom level is set by the zoomScale property of the UIScrollView. Its maximum and minimum is set by maximumZoomScale and minimumZoomScale respectively.

    If you're trying to set the zoom by setting the contentSize then you're doing it wrong. The contentSize should be set as if the zoom scale was 1.0 and then you'd just set the zoomScale property to be what you wanted so for example 2.0 if you wanted it zoomed in to 200%.

    You're probably seeing contentSize change as you zoom because I think the scroll view reports it scaled to the current zoom scale.

    0 讨论(0)
提交回复
热议问题