回答

0

您可以使用

CGRect rectInSuperView = [button convertRect:button.frame toView:superview]; 

檢查documentation

+0

感謝您的重播。我無法得到UIButton的確切座標。在我的情況下,UIButton座標是(109,176,72,37),但convertRect:toView:返回值是(218,352,72,37),值更改的原因是什麼? – John 2011-12-21 04:59:26

+0

我知道了,將代碼改爲CGRect rectInSuperView = [[button superview] convertRect:button.frame toView:Yourview]; – John 2011-12-21 05:55:06

相關問題