本文介绍了在UINavigationController中,topViewController,visibleViewController,presentsViewController有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UINavigationController 有3个控制器,听起来与我非常相似: topViewController visibleViewController presentsViewController

UINavigationController has 3 controllers that all sound very similar to me: topViewController, visibleViewController, and presentedViewController.

您在哪些场景中使用这些控制器?

Which scenarios do you use each of these controllers in?

推荐答案

presentsViewController 是屏幕上显示的当前模式。
topViewController 是导航堆栈顶部的视图控制器(参见 viewControllers()方法)和 visibleViewController 是屏幕上当前显示的视图控制器(可以是控制器,模态, UINavigationController UITabbarController 等。)

presentedViewController is the current modal presented on screen.topViewController is view controller on top of the navigation stack (see viewControllers() method) and visibleViewController is the currently displayed view controller on screen (can be either a controller, a modal, a UINavigationController, a UITabbarController, etc).

这篇关于在UINavigationController中,topViewController,visibleViewController,presentsViewController有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 00:42