-
- - (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;
-
- - (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view;
-
-
- - (CGRect)convertRect:(CGRect)rect toView:(UIView *)view;
-
- - (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view;
例把UITableViewCell中的subview(btn)的frame转换到 controllerA中
-
-
- CGRect rc = [cell convertRect:cell.btn.frame toView:self.view];
- 或
- CGRect rc = [self.view convertRect:cell.btn.frame fromView:cell];
-
-
- 或当已知btn时:
- CGRect rc = [btn.superview convertRect:btn.frame toView:self.view];
- 或
- CGRect rc = [self.view convertRect:btn.frame fromView:btn.superview];