1
我是iOS開發新手。現在我正在實施一個UIPanGestureRecognizer
模型應用程序。我有一個UIButton
的UIPanGestureRecognizer
。我的問題是,如何從超級視圖(如UIView
,UIScrollView
等)訪問UIButton
的居民座標?如何從超級視圖中訪問UIButton的當前座標,發生時UIGestureRecognizerStateEnd
如果有人知道請幫助我。
感謝您的重播。我無法得到UIButton的確切座標。在我的情況下,UIButton座標是(109,176,72,37),但convertRect:toView:返回值是(218,352,72,37),值更改的原因是什麼? – John 2011-12-21 04:59:26
我知道了,將代碼改爲CGRect rectInSuperView = [[button superview] convertRect:button.frame toView:Yourview]; – John 2011-12-21 05:55:06