简体   繁体   English

不了解pushViewController的概念

[英]Don't Understand the concept of the pushViewController

Can Anyone explain me the concept of Pushing and Popping Stack Items in UINavigationController .I only know the meaning of the Push and Pop that used in stack opreation in Data Structure but Don't know how it work in UINavigationController .Please also explain the the following functions of it. 任何人都可以向我解释UINavigationController的推入和弹出堆栈项的概念。我只知道数据结构中栈操作中使用的PushPop的含义,但不知道它在UINavigationController是如何工作的。还请解释以下内容它的功能。

pushViewController:animated:

- popViewControllerAnimated:

- popToRootViewControllerAnimated:

- popToViewController:animated:

interactivePopGestureRecognizer

Thanks. 谢谢。

Its the same concept as a stack in a data structure really, except you can only view whats on the top (ie the top viewcontroller in your navigation stack) 实际上,它与数据结构中的堆栈的概念相同,只是您只能在顶部查看内容(即,导航堆栈中的顶部viewcontroller)

so pushing a viewcontroller means its going on top of the stack (animates coming in from the right) popping a viewcontroller will take a viewcontroller off the top (which is the current one you are looking at) so it will animate off the right of the screen, showing the viewcontroller that was underneath the top one 因此推入ViewController意味着将其放在堆栈顶部(动画从右侧进入),弹出ViewController将使ViewController脱离顶部(这是您正在查看的当前视图),因此它将在ViewController的右侧进行动画处理屏幕,显示位于顶部控件下方的ViewController

popToRootViewController is effectively just popping until you hit the very last viewcontroller in your navigation stack popToRootViewController实际上只是弹出,直到您在导航堆栈中点击了最后一个viewcontroller

popToViewController pops until a particular viewcontroller is on the top popToViewController弹出,直到顶部有一个特定的viewcontroller

Hope thats all the clarification you need 希望这就是您需要的所有澄清

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

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