gpt4 book ai didi

iphone - 在 UINavigationController 层次结构的中间添加 Flip View 类型 Controller

转载 作者:行者123 更新时间:2023-12-03 19:35:46 25 4
gpt4 key购买 nike

我目前有一个基于 UINavigationController 的应用程序,运行得很好。我想采用 UINavigationController 堆栈深处几个级别的 View Controller 之一来获得“翻转”类型 View ,如实用程序应用程序等所示。这是非常常见的事情。

这里的问题是我创建了一个中间 View Controller 来管理将要来回翻转的 View Controller 。现在,中间 View Controller 拦截并用层次结构中自己的导航栏覆盖导航栏。现有 View Controller 中的导航栏被屏蔽,并且其整个 View 向下移动。

我尝试过这样做:

myFlipViewController.view = myOriginalViewController.view;

这打破了 myOriginalViewController 的整个 View ,因为它有自己的 navigationItems。我基本上只是希望 myFlipViewController 充当透明代理,控制翻转 myOriginalViewController 和 othersideViewController。 myOriginalViewController 中的 navigationItems 仍应显示。

我在 View Controller 中尝试了各种 setNavigationBarHidden,但似乎没有任何效果。

在 UINavigationController 堆栈中间引入 FlipViewController 而又不妨碍它的最佳方法是什么?

最佳答案

@implementation YourViewControllerInTheMiddleOfTheStack

- (void)presentFlipSideViewController:(UIViewController *)flipsideViewController
{
flipsideViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentModalViewController:flipsideViewController animated:YES];
}

@end

关于iphone - 在 UINavigationController 层次结构的中间添加 Flip View 类型 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1088503/

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