查看当前view tree结构
下列代码加入到AppDelegate
- (void)dumpView:(UIView *)aView atIndent:(int)indent into:(NSMutableString *)outstring { for (int i = 0; i < indent; i++) [outstring appendString:@"--"]; [outstring appendFormat:@"[%2d] %@\n", indent, [[aView class] description]]; for (UIView *view in [aView subviews]) [self dumpView:view atIndent:indent + 1 into:outstring]; } // Start the tree recursion at level 0 with the root view - (NSString *) displayViews: (UIView *) aView { NSMutableString *outstring = [[NSMutableString alloc] init]; [self dumpView: self.window atIndent:0 into:outstring]; return outstring ; } // Show the tree - (void)logViewTreeForMainWindow { // CFShow([self displayViews: self.window]); NSLog(@"The view tree:\n%@", [self displayViews:self.window]); }
然后在你想使用的地方使用
AppDelegate *a=(AppDelegate *)[[UIApplicationsharedApplication] delegate];
[a logViewTreeForMainWindow];
此时打印的就是 当前的view tree
如下:
[ 0] UIWindow --[ 1] UILayoutContainerView ----[ 2] UITransitionView ------[ 3] UIViewControllerWrapperView --------[ 4] UILayoutContainerView ----------[ 5] UINavigationTransitionView ------------[ 6] UIViewControllerWrapperView --------------[ 7] UITableView ----------------[ 8] UITableViewCell ------------------[ 9] UITableViewCellContentView --------------------[10] UILabel --------------------[10] UIImageView ------------------[ 9] UIButton --------------------[10] UIImageView ------------------[ 9] UIView ----------------[ 8] UITableViewCell ------------------[ 9] UITableViewCellContentView --------------------[10] UILabel --------------------[10] UIImageView ------------------[ 9] UIButton --------------------[10] UIImageView ------------------[ 9] UIView ----------------[ 8] UITableViewCell ------------------[ 9] UITableViewCellContentView --------------------[10] UILabel --------------------[10] UIImageView ------------------[ 9] UIButton --------------------[10] UIImageView ------------------[ 9] UIView ----------------[ 8] UITableViewCell ------------------[ 9] UITableViewCellContentView --------------------[10] UILabel --------------------[10] UIImageView ------------------[ 9] UIButton --------------------[10] UIImageView ------------------[ 9] UIView ----------------[ 8] UITableViewCell ------------------[ 9] UITableViewCellContentView --------------------[10] UILabel --------------------[10] UIImageView ------------------[ 9] UIButton --------------------[10] UIImageView ------------------[ 9] UIView ----------------[ 8] UITableViewCell ------------------[ 9] UITableViewCellContentView --------------------[10] UILabel --------------------[10] UIImageView ------------------[ 9] UIButton --------------------[10] UIImageView ------------------[ 9] UIView ----------------[ 8] _UITableViewSeparatorView ----------------[ 8] _UITableViewSeparatorView ----------------[ 8] _UITableViewSeparatorView ----------------[ 8] _UITableViewSeparatorView ----------------[ 8] _UITableViewSeparatorView ----------------[ 8] _UITableViewSeparatorView ----------------[ 8] _UITableViewSeparatorView ----------[ 5] UINavigationBar ------------[ 6] UIMoreListController ------------[ 6] UINavigationItemView ------------[ 6] UINavigationButton --------------[ 7] UIImageView --------------[ 7] UIButtonLabel ----[ 2] UITabBarCustomizeView ------[ 3] UINavigationBar --------[ 4] UINavigationBarBackground --------[ 4] UINavigationItemView --------[ 4] UINavigationButton ----------[ 5] UIImageView ----------[ 5] UIButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ----[ 2] UITabBar ------[ 3] _UITabBarBackgroundView ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel ------[ 3] UITabBarButton --------[ 4] UITabBarSelectionIndicatorView --------[ 4] UITabBarSwappableImageView --------[ 4] UITabBarButtonLabel
相关推荐
IOS打印功能
iOS XIB创建View
各种ios view代码实现初学者很实用
但是,苹果对于我们的NSDictionary、NSSet、NSArray等值有中文时,打印出来的是Unicode编码,人类无法直接读懂,因此,笔者研究研究如何将打印出来的日志保持原有的格式化且能够将Unicode编码打印出来是正常人类可读...
iOS蓝牙小票机打印小票 图片 二维码
ios开发实现socket连接局域网打印机打印,打印机和ios设备在同一局域网
ios的蓝牙打印库,设定了全面的打印格式,以及打印机连接的功能
Caysn打印机IOS打印示例程序。 使用PrinterLibs.framework控制打印机打印。 可打印文本,图形,条码,二维码。 可以控制切刀,钱箱,蜂鸣器。
为了能在打印前看到效果,节省点测试纸张,在上次的蓝牙打印机打印小票的功能上...(因小票的字体和间距与iOS中的字体和间距不一样,所以预览效果与实际效果有些许偏差,预览作为辅助布局用,最终以实际打印效果为准)
iOS View的动画
ios版连接蓝牙打印机开发demo,包含开发文档,中文编程手册,指令集
iOS手机端log打印显示工具源码,在不连接xcode时,你仍然可以清晰的看到app内系统日志以及NSLog打印的日志,开发调试必不可少,大大提高调试效率,不用时时都链接xcode。 快速方便集成,两行代码即可搞定。 这里提供...
iOS-Tree-Component ,iOS-Tree-Component 是 iOS 用来显示树状结构的控件,是 UITableView...
iOS version view.Scriptable
iOS使用CocoaAsyncSocket连接打印机打印小票,demo封装了socket连接管理类,打印机指令管理类.
DropView
ios的几种常用的背景图片设置。 其中有三种 1.添加UIImageView 2.取图片色 3.取图片路径
昨天写了个模仿UC浏览器菜单栏弹出的动画效果,对ios的动画机制有了个大致的了解,这次为了更加熟悉ios的动画,又写了个推出菜单栏的动画。与上次那个唯一的区别就是它把整个view都向右位移了,因此看上去是推出来,...
IOS 使用XIB 自定义View http://blog.csdn.net/li6185377/article/details/8131042
一个简单的view间碰撞动画demo