獲取控件在屏幕的相對座標實現代碼:io
UIWindow * window=[[[UIApplication sharedApplication] delegate] window];view
CGRect rect=[view convertRect: view.bounds toView:window]; //獲取控件view的相對座標vi