
正文
当前View的坐标相对其他View的位置坐标
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
// 将rect由rect所在视图转换到目标视图view中,返回在目标视图view中的rect
- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view;
// 将rect从view中转换到当前视图中,返回在当前视图中的rect
- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view;
例子:
//转换的相对位置weakCell 相对于父控件的位置坐标
CGRect weakCellFrame = [weakCell convertRect:weakCell.bounds toView:weakSelf.parentController.view];







