gpt4 book ai didi

iphone - [[UIWindow keyWindow] _autolayoutTrace] 输出中星号 (*) 的含义是什么

转载 作者:技术小花猫 更新时间:2023-10-29 11:04:26 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com