簡體   English   中英

[[UIWindow keyWindow] _autolayoutTrace]]輸出中的星號(*)是什么意思

[英]What's the meaning of the Asterisk (*) in the output of [[UIWindow keyWindow] _autolayoutTrace]]

UIWindow具有專用方法_autolayoutTrace,可幫助您查找模糊的布局。 它非常好用且方便,輸出如下所示:

*<UIWindow:0x13436fd0> - AMBIGUOUS LAYOUT
|   *<UIView:0xd5e0b30>
|   |   *<PbJellyContentContainerView:0xd5e0ff0>
|   |   |   *<UIView:0x20710ee0>
|   |   |   |   *<PbMapContainerView:0x20710c90>
|   |   |   |   |   <MKMapView:0x2070df70>
|   |   |   |   |   |   <UIView:0xd1cca20>
|   |   |   |   |   |   |   <MKBasicMapView:0xd1cd020>
....

我的問題不是任何歧義。 它是關於某些視圖前面的星號的。 它是什么意思?

我的猜測是它會標記所有使用自動布局的視圖。 但是系統如何確定呢?

更新:

似乎星號標記了具有至少一個約束集或具有至少一個約束集的子視圖的所有視圖。

在不設置約束的情況下將translatesAutoresizingMaskIntoConstraints設置為false不會給出星號。

這是WWDC 2015會話#219視頻 -[UIView _autolayoutTrace]的圖例

* - is laid out with auto layout
+ - is laid out manually, but is represented in the layout engine because translatesAutoresizingMaskIntoConstraints = YES
• - layout engine host

我想你的意思是, *是指可以應用自動布局的組件。 我的意思是,如果有按鈕,它將顯示為

*<UIRoundedRectButton:0x1f053a50>
|   |   |   <UIGroupTableViewCellBackground:0x1f053b20>
|   |   |   <UIImageView:0x1f0542f0>
|   |   |   <UIButtonLabel:0x1f053db0>

這意味着您可以設置rectButton,並且可以在其上應用自動布局,而下面的其他3個將自動進行布局。

*僅在UI中至少有1個組件的UIAutolayout為ON時顯示,如果所有組件都沒有Autolayout,則它將整個UIView理解為單個組件,因此不會顯示*

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM