0
mainviewcontrollerのサブビューにあるUIButtonの座標を取得しようとしています。下のコードでサブビューを基準にして返すことができますが、mainviewcontrollerに関連してUIButtonの位置を返すにはどうすればよいですか?UIButtonから位置座標を取得
ScrollingAppDelegate * appDelegate =(ScrollingAppDelegate *)[[UIApplication sharedApplication] delegate]; CGPoint canXY = appDelegate.globalcanButtonReference.frame.origin; NSLog(@ "%f%f"、canXY.x、canXY.y);あなたは、これは動作するはずです、すべてのビューへの参照を持っていないと仮定すると、
これは素晴らしい仕事、ありがとう、私は本当に感謝束:) – user973984