简体   繁体   English

UINavigationController的方法将视图控制器添加到导航堆栈?

[英]Method of UINavigationController to add a view controller to navigation stack?

UINavigationController的哪种方法用于将视图控制器快速添加到导航堆栈?

Normally, the following method is used to push UIViewController to UINavigationController 's navigation stack 通常,以下方法用于将UIViewController推送到UINavigationController的导航堆栈

pushViewController(_ viewController: UIViewController, animated: Bool)

This is implemented inside your CustomViewController class in the following way: 这是通过以下方法在CustomViewController类中实现的:

let someVC: CustomViewController = CustomViewController() // this is one way of initializing it
self.navigationController?.pushViewController(someVC, animated: true)

The following is another method which can be used to add a UIViewController to UINavigationController stack 以下是可用于将UIViewController添加到UINavigationController堆栈的另一种方法

setViewControllers(_ viewControllers: [UIViewController], animated: Bool)

暂无
暂无

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

相关问题 将UINavigationController添加到导航堆栈 - Add UINavigationController to navigation stack 在Segue期间从UINavigationController的导航堆栈中删除视图控制器? - Removing a view controller from the navigation stack of UINavigationController during segue? 在导航堆栈中跳过/添加视图控制器 - Skip/Add a View Controller in Navigation Stack iOS UINavigationController-从导航堆栈中删除视图控制器确实会完全释放它 - iOS UINavigationController - removing a view controller from the navigation stack does release it at all UINavigationController,在堆栈上具有相同视图控制器的两个副本 - UINavigationController with two copies of the same view controller on stack 制作新的UINavigationController,然后以编程方式清空旧的导航控制器堆栈 - Make new UINavigationController then empty stack of old navigation controller programatically 弹出以查看导航堆栈中的控制器 - Pop to view controller in navigation stack 在UINavigationController的视图控制器堆栈中的某些视图控制器中未调用didReceiveMemoryWarning - didReceiveMemoryWarning is not called in some view controllers in UINavigationController's view controller stack iOS:如果不使用UINavigationController,以编程方式查看导航堆栈中的视图控制器? - iOS: programmatically see view controllers in navigation stack if not using a UINavigationController? 在UINavigationController堆栈中的先前视图控制器中更新数据的最佳方法 - Best way to update data in a previous view controller in a UINavigationController stack
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM