计算View中的子View在View的superview中的坐标
来源:互联网 发布:羽毛球鹰眼算法 编辑:程序博客网 时间:2024/06/10 20:15
例如一个视图控制器的view中有一个UITableView,UITableView的某个cell中有个UITextField,想要得到UITextField在view中的位置,就要靠上面的两个方法了。
CGRect rect = [self.view convertRect:textField.frame fromView:textField.superview];
或者
方法2、
CGRect rect = [textField.superview convertRect:textField.frame toView:self.view];
进行转换就可以了。
类似的方法还有:
- (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view
- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view
0 0
- 计算View中的子View在View的superview中的坐标
- 获取View在屏幕中的坐标
- 获取View在onCreate中的坐标
- android删除一个view中的子view
- Activity 中的root view 添加子view的大致过程
- 在Android中将子View的坐标转换为父View的坐标
- self.view.window, self.view.superView的意思
- 使用getLocationInWindow或getLocationOnScreen获得View在屏幕中的坐标
- [iOS 删除view下面的所有view] 一句话代码删除self.view中的子控件
- UINavigationController下view及子view的坐标及高度
- view在UIViewController中的生命周期
- view在UIViewController中的生命周期
- Android在View中的动画
- view在UIViewController中的生命周期
- view在UIViewController中的生命周期
- CListCtrl在view中的使用
- view在UIViewController中的生命周期
- View在屏幕中的位置
- go语言学习笔记
- 过河卒(动态规划)
- php实现Bloom Filter
- iOS开发系列--视图切换
- vs project properties配置
- 计算View中的子View在View的superview中的坐标
- Android实战简易教程-第二十六枪(基于ViewPager实现微信页面切换效果)
- 我的收藏
- eclipse -解决Unhandled event loop exception GC overhead limit exceeded
- N种内核注入DLL的思路及实现
- Android系统原理与源码分析(1):利用Java反射技术阻止通过按钮关闭对话框
- mysql更改某个字段的默认值
- 使用unordered_map编译报#error This file requires compiler and library support
- 解包官方UPDATA.APP文件神器工具bootimg.exe工具及详细教程