iOS 在控制台console lldb 输出某个view 的层级结构

在控制台 LLDB   环境中    

po  [self.view recursiveDescription]

就可以输出 该 view的层级结构

 

<UILayoutContainerView: 0x7ffc8a5dae30; frame = (0 0; 375 667); autoresize = W+H; gestureRecognizers = <NSArray: 0x7ffc90f07270>; layer = <CALayer: 0x7ffc90f15e10>>

   | <UINavigationTransitionView: 0x7ffc8f3a0fd0; frame = (0 0; 375 667); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x7ffc8f394e60>>

   | <UINavigationBar: 0x7ffc8a5ac240; frame = (0 0; 375 44); autoresize = W; gestureRecognizers = <NSArray: 0x7ffc8f7c1e60>; layer = <CALayer: 0x7ffc8f3ec9f0>>

   |    | <_UINavigationBarBackground: 0x7ffc8a5495c0; frame = (0 0; 375 44); autoresize = W; userInteractionEnabled = NO; layer = <CALayer: 0x7ffc8f7bd6d0>>

   |    |    | <UIImageView: 0x7ffc90fdfd10; frame = (0 44; 375 0.5); userInteractionEnabled = NO; layer = <CALayer: 0x7ffc8f3d6e70>>

   |    | <_UINavigationBarBackIndicatorView: 0x7ffc8f7adf80; frame = (0 11.5; 13 21); alpha = 0; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7ffc8c76b1e0>>

   |    | <UINavigationItemView: 0x7ffc8f7ab790; frame = (0 0; 0 0); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7ffc8f776e80>>

   |    |    | <UILabel: 0x7ffc90fb8ec0; frame = (0 11.5; 0 21.5); text = '骆驼书'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ffc921ef0a0>>

   | <UIView: 0x7ffc90bc6e60; frame = (0 64; 375 44); layer = <CALayer: 0x7ffc90be1020>>

   |    | <UIButton: 0x7ffc90bf9360; frame = (0 0; 62.5 44); opaque = NO; tag = 1; layer = <CALayer: 0x7ffc90bc68d0>>

   |    |    | <UIButtonLabel: 0x7ffc90bf9580; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ffc8a7bd880>>

   |    | <UIButton: 0x7ffc90be0b90; frame = (62.5 0; 62.5 44); opaque = NO; tag = 2; layer = <CALayer: 0x7ffc90be0db0>>

   |    |    | <UIButtonLabel: 0x7ffc90a62b40; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ffc90a62d00>>

   |    | <UIButton: 0x7ffc90ab2130; frame = (125 0; 62.5 44); opaque = NO; tag = 3; layer = <CALayer: 0x7ffc90ab2350>>

   |    |    | <UIButtonLabel: 0x7ffc90ab2450; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ffc90ab2610>>

   |    | <UIButton: 0x7ffc8a7de500; frame = (187.5 0; 62.5 44); opaque = NO; tag = 4; layer = <CALayer: 0x7ffc8a7de720>>

   |    |    | <UIButtonLabel: 0x7ffc90bd8c10; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ffc90bd8dd0>>

   |    | <UIButton: 0x7ffc90a924a0; frame = (250 0; 62.5 44); opaque = NO; tag = 5; layer = <CALayer: 0x7ffc90a926c0>>

   |    |    | <UIButtonLabel: 0x7ffc8c6dae00; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ffc90a927c0>>

   |    | <UIButton: 0x7ffc90a94670; frame = (312.5 0; 62.5 44); opaque = NO; tag = 6; layer = <CALayer: 0x7ffc90a94890>>

   |    |    | <UIButtonLabel: 0x7ffc90a94990; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ffc90a94b50>>

   |    | <UIView: 0x7ffc90bd57c0; frame = (0 40; 62.5 4); alpha = 0.8; layer = <CALayer: 0x7ffc90bde120>>

你可能感兴趣的:(console)