If you have UIView's embeded within other UIView's, when you get the .frame.origin.x value of a widget in the internal embedded view, it gives you the x/y value for the position in the internal view's coordinate system.
I want to get the x/y position of the element in the absolute coordinate system of the entire iPad visible area. (Or with respe开发者_如何学编程ct to the top-most view.)
There are methods which can help you to convert frame.
- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view
- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view
CGRect f = [someView convertRect:someView.bounds toView:window];
精彩评论