简体   繁体   English

在iOS应用程序中跟踪UIWIndow上的视图

[英]Tracking of views on UIWIndow In iOS app

WHen we use navigation controller as a root of window and we pushed multiple controllers on that navigation controller. 然后,我们将导航控制器用作窗口的根,并在该导航控制器上推送了多个控制器。 lets say A as navigation controller B as root of navigation controller C is pushed on BD is pushes on C 假设A作为导航控制器B,而B作为导航控制器C的根被推入BD

then what will be hierarchi of views on window. 那么将是窗口视图的层次结构。 is it like first Window -> A -> B -> C -> D; 就像第一个窗口-> A-> B-> C-> D一样吗?

or they are in memory but on window there is only one D? 还是它们在内存中,但是在窗口上只有一个D?

You can do investigation by your own, just print during debug : 您可以自己进行调查,只需在调试期间打印即可:

po [[UIWindow keyWindow] recursiveDescription]

It will show you full View hierarchy for your app. 它将为您显示应用程序的完整View层次结构。

But yes, the final structure looks like: 但是,是的,最终结构如下所示:

UIWindow -> UINavigationController.view -> RootViewController.view -> OtherViewControllerView -> Subview's UIWindow-> UINavigationController.view-> RootViewController.view-> OtherViewControllerView->子视图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM