iOS: 查看 UIView 的视图树

在想要查看的 UIView 附近打个断点,运行,直到停在断点处,在控制台键入:po [view recursiveDescription],回车。

(lldb) po [self recursiveDescription]
<BPSearchBar: 0xaab5fe0; baseClass = UISearchBar; frame = ( ; ); text = ''; opaque = NO; autoresize = LM+RM+TM; gestureRecognizers = <NSArray: 0xaab7c80>; layer = <CALayer: 0xaab6210>>
| <UIView: 0xaab7470; frame = ( ; ); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0xaab74d0>>
| | <UISearchBarBackground: 0xaab7f90; frame = ( ; ); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0xaab80e0>>
| | <UISearchBarTextField: 0xaab8bf0; frame = ( ; ); text = ''; clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0xb9c4a30>; layer = <CALayer: 0xaab8d80>>
| | | <UITextFieldBorderView: 0xb9d37e0; frame = ( ; ); opaque = NO; layer = <CALayer: 0xb9d38f0>>
| | | <UIImageView: 0xaabb4c0; frame = ( 7.5; 12.5 12.5); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0xaabb0e0>> (lldb)
上一篇:Linux parted命令详解


下一篇:Failed to create the Java Virtual Machine.问题的解决