Getting the visible rect of an UIScrollView's content

前端 未结 8 524
故里飘歌
故里飘歌 2020-11-30 19:17

How can I go about finding out the rect (CGRect) of the content of a displayed view that is actually visible on screen.

myScrollView.bounds

8条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 19:42

    I don't think that a UIScrollView gives you that rectangle directly, but I think you have all the necessary items to calculate it.

    A combination of the bounds, the contentOffset and the zoomScale should be all you need to create the rectangle you are looking for.

提交回复
热议问题