iOS UIView中的坐标转换
来源:互联网 发布:螺旋打印二维数组 编辑:程序博客网 时间:2024/05/16 11:03
IOS-- UIView中的坐标转换
// 将像素point由point所在视图转换到目标视图view中,返回在目标视图view中的像素值
- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;
// 将像素point从view中转换到当前视图中,返回在当前视图中的像素值
- (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view;
// 将rect由rect所在视图转换到目标视图view中,返回在目标视图view中的rect
- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view;
// 将rect从view中转换到当前视图中,返回在当前视图中的rect
- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view;
// controllerA 中有一个UITableView, UITableView里有多行UITableVieCell,cell上放有一个button
// 在controllerA中实现:
CGRect rc = [cell convertRect:cell.btn.frame toView:self.view];
或
CGRect rc = [self.view convertRect:cell.btn.frame fromView:cell];
// 此rc为btn在controllerA中的rect
或当已知btn时:
CGRect rc = [btn.superview convertRect:btn.frame toView:self.view];
或
CGRect rc = [self.view convertRect:btn.frame fromView:btn.superview];
- iOS-- UIView中的坐标转换
- [iOS]UIView中的坐标转换
- iOS --- UIView中的坐标转换
- iOS UIView中的坐标转换
- IOS-- UIView中的坐标转换
- IOS-- UIView中的坐标转换
- iOS开发笔记--UIView中的坐标转换
- IOS-- UIView中的坐标转换
- ios开发 - UIView中的坐标转换
- IOS-- UIView中的坐标转换
- IOS-- UIView中的坐标转换
- IOS-- UIView中的坐标转换
- IOS-- UIView中的坐标转换
- iOS开发笔记--UIView中的坐标转换
- IOS-- UIView中的坐标转换
- IOS-- UIView中的坐标转换
- IOS-- UIView中的坐标转换
- iOS开发笔记--UIView中的坐标转换
- 使用Mycat操作Oracle数据库(二) -- 使用源码调试
- 学习kotlin第14天_区间、类型检查与转换、this表达式、相等性
- 《Hardware Accelerated Convolutional Neural Networks for Synthetic Vision Systems》笔记
- VC编译选项 多线程(/MT) 多线程调试(/MTd) 多线程 DLL (/MD) 多线程调试 DLL (/MDd)
- 2016/6/16 make menuconfig
- iOS UIView中的坐标转换
- Yii2 接收不到 axios 发送数据的解决方法
- socket通信
- 第一篇博客
- Mysql数据库调优和性能优化的21条最佳实践
- Unity Shader之波浪效果
- 《人工智能三愿》笔记
- 设计模式入门:迭代器模式
- Android 静态方法调用非静态方法