如何确定 iPhone 程序在模拟器上运行时的 View 结构?
最佳答案
有一种内置方法可以转储 View 层次结构:recursiveDescription
NSLog(@"%@", [查看递归描述]);
它会输出如下内容:
<UIView: 0x6a107c0; frame = (0 20; 320 460); autoresize = W+H; layer = […]
| <UIRoundedRectButton: 0x6a103e0; frame = (124 196; 72 37); opaque = NO; […]
| | <UIButtonLabel: 0x6a117b0; frame = (19 8; 34 21); text = 'Test'; […]
参见:https://developer.apple.com/library/content/technotes/tn2239/_index.html
关于iphone - 我需要检查 iPhone 程序上的 View 层次结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2343246/