簡體   English   中英

在UIScrollView容器視圖的坐標系中確定UIScrollView的子視圖框架

[英]Determining a UIScrollView's subview frame in the coordinate system of UIScrollView's container view

在UIScrollView中,我有一個子視圖。 如何根據UIScrollView的容器視圖坐標系確定子視圖的框架?

您可以簡單地使用以下內容。

[scrollViewSuperview convertRect:subview.frame fromView:subview]

您可以在http://developer.apple.com/library/ios/ipad/#documentation/uikit/reference/uiview_class/uiview/uiview.html上找到有關此信息的更多信息。

屬性view.frame始終與父視圖相關,因此子視圖的frame將是放置子視圖的滾動視圖內的rect。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM