gpt4 book ai didi

iphone - 如何从 View 层次结构中选择随机 View Controller

转载 作者:行者123 更新时间:2023-11-28 22:56:14 25 4
gpt4 key购买 nike

我正在构建一个应用程序,我在其中执行此层次结构:

view1controller(调用presentmodalviewcontroller方法)-->view2controller(调用presentmodalviewcontroller方法)-->view3controller(调用presentmodalviewcontroller方法)--->view4controller

我知道我总是可以使用 dismissmodalviewcontroller 方法从一个 View 切换回另一个 View 的概念。就像我可以从 View 4 切换到 View 3 以及从 View 3 切换到 View 2 一样。我的问题是如何切换到随机 View Controller ?喜欢从 View 4 到 View 2 还是从 View 3 到 View 1? ..我没有使用导航 Controller 。我知道我错过了一个概念。谁能阐明这个概念。

最佳答案

来自引用指南UIViewController

If you present several view controllers in succession, thus building a stack of presented view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack.

关于iphone - 如何从 View 层次结构中选择随机 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10751619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com