作者热门文章
- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
UIWindow 有一个私有(private)方法 _autolayoutTrace 可以帮助你找到不明确的布局。它非常好用和方便,输出如下:
*<UIWindow:0x13436fd0> - AMBIGUOUS LAYOUT
| *<UIView:0xd5e0b30>
| | *<PbJellyContentContainerView:0xd5e0ff0>
| | | *<UIView:0x20710ee0>
| | | | *<PbMapContainerView:0x20710c90>
| | | | | <MKMapView:0x2070df70>
| | | | | | <UIView:0xd1cca20>
| | | | | | | <MKBasicMapView:0xd1cd020>
....
我的问题不是关于任何歧义的。它是关于某些 View 前面的星号。什么意思?
我的猜测是它标记了所有使用自动布局的 View 。但系统如何确定这一点?
更新:
似乎星号标记了所有至少有一个约束集或 subview 至少有一个约束集的 View 。
将 translatesAutoresizingMaskIntoConstraints 设置为 false 而不设置约束不会给出星号。
最佳答案
这是来自 WWDC 2015 session #219 video 的 -[UIView _autolayoutTrace]
的图例31:00
* - is laid out with auto layout
+ - is laid out manually, but is represented in the layout engine because translatesAutoresizingMaskIntoConstraints = YES
• - layout engine host
关于iphone - [[UIWindow keyWindow] _autolayoutTrace] 输出中星号 (*) 的含义是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18522420/
UIWindow 有一个私有(private)方法 _autolayoutTrace 可以帮助你找到不明确的布局。它非常好用和方便,输出如下: * - AMBIGUOUS LAYOUT | * |
我是一名优秀的程序员,十分优秀!