![](/img/trans.png)
[英]iPhone how i can I do multiple columns in UITableView/UIImageView
[英]I have a UIImageView in a UITableView Header. How can I get the exact y/x coordinates of that UIImageView at any time?
我在UITableView標頭中有一個UIImageView。 如何隨時獲取該UIImageView的確切y / x坐標?
我需要知道屏幕上確切的x / y點,即使用戶在表視圖中上下滾動時也是如此。 如果可能的話,有人可以給我指出一些示例代碼嗎?
只是調用它不起作用:
itemImageView.frame.origin.x, itemImageView.frame.origin.y
它只是為我提供了與tableView本身相關的坐標,無論它在窗口上的實際位置如何。
謝謝。
我相信您想要的是UIView convertPoint視圖。 您可以將獲得的點轉換為表格視圖的空間。
我最終使用了CGRect rect = [infoTableView convertRect:itemImageView.frame toView:nil];
而且效果很好。 謝謝您的幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.