iOS 打印出视图中所有的子视图的名称
来源:互联网 发布:h5棋牌游戏源码 编辑:程序博客网 时间:2024/05/16 14:58
使用递归:
- (void)listSubviewsOfView:(UIView *)view { // Get the subviews of the view NSArray *subviews = [view subviews]; // Return if there are no subviews if ([subviews count] == 0) return; // COUNT CHECK LINE for (UIView *subview in subviews) { // Do what you want to do with the subview NSLog(@"%@", subview); // List the subviews of subview [self listSubviewsOfView:subview]; }}
方法转载自:http://stackoverflow.com/a/7244069/3458781
打印结果:
2014-10-10 16:05:14.191 MyAPP[1951:60b] <UIView: 0x16d61a90; frame = (0 64; 320 31); autoresize = RM+BM; layer = <CALayer: 0x16ddb850>>2014-10-10 16:05:14.192 Vinyo[1951:60b] <UILabel: 0x16d1aa60; frame = (15 70; 210 20); text = 'Choose a credit card'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x16d1c7f0>>
0 0
- iOS 打印出视图中所有的子视图的名称
- iOS遍历打印所有子视图
- iOS遍历视图里的所有子视图
- iOS子视图中找到特定类型的视图
- [SQL] 如何获取数据库视图中所有列的名称
- ios 私有方法打印出任意视图的视图层次结构
- iOS 遍历所有子视图subviews的2种方法
- iOS使用递归来获取view的所有子视图
- [ios]移除当前视图下的所有子控件
- iOS 移除所有子视图的方法
- iOS 删除所有子视图
- 移除指定视图的所有子视图
- 移除所有的子视图
- 遍历UIView的所有子视图
- 根据视图名称查询当前视图关联的所有表的所有字段
- ios开发 获取一个视图的子视图的方法
- ios 打印出所有的字体
- iOS 子视图在父视图的显示范围
- x的n次方(编程珠玑第四章)
- openwrt启动进程分析
- 舞伴配对问题
- C 字符串转数字
- HTML5 的富文本编辑器工具栏Popline
- iOS 打印出视图中所有的子视图的名称
- 多控制器管理 ——程序启动过程
- Netgear JNR3300 调试总结
- L-BFGS的原理及在回归分析中的应用
- C99的restrict关键词
- TOMCAT目录结构
- S3C2440的RTC解析
- 2014.10.10
- java中equals方法的用法以及==的用法(转)