convertRect:toView: 和 convertRect:fromView:

方法 相同点 不同点
newRect = [someView convertRect:rect toView:toView]; 只改变rect的origin,size不变 rect是相对于someView的,以toView为坐标系重新计算rect的值
newRect = [someView convertRect:rect fromView:fromView] 只改变rect的origin,size不变 rect是以fromView为坐标系下的值,将rect转为以someView为坐标系的值

参考https://www.jianshu.com/p/dcefe7150bfe

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。