iphone - 翻转由 UINavigationController 管理的 UIViewController 会隐藏导航栏

标签 iphone uinavigationcontroller modalviewcontroller

我已经在 UINavigationContoller 上降低了 2 个级别,并且已经推送了一些 View 。现在,我正在查看其中一个推送 View Controller 内的图像,当我点击导航栏中的信息按钮时,我希望 subview 翻转,将导航栏保留在原位。如何让 subview (被推送的 View )翻转?现在,导航栏也会翻转并阻止我导航回堆栈。

-(void)showImageInfo
{   
    self.imgInfoViewController = [[ImageInfoViewController alloc] initWithNibName:@"ImageInfoViewController" bundle:nil];

    [self.imgInfoViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];

    [self.navigationController presentModalViewController:self.imgInfoViewController animated:YES];

}

最佳答案

UICatalog 示例中的代码...我认为它会满足您的需求。基本上你必须做更多的编码才能获得翻转行为。

http://developer.apple.com/iphone/library/samplecode/UICatalog/Listings/TransitionViewController_m.html#//apple_ref/doc/uid/DTS40007710-TransitionViewController_m-DontLinkElementID_34

  - (IBAction)flipAction:(id)sender
    {
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:kTransitionDuration];

        [UIView setAnimationTransition:([self.mainView superview] ? UIViewAnimationTransitionFlipFromLeft :UIViewAnimationTransitionFlipFromRight)                                      forView:self.containerView  cache:YES];
        if ([flipToView superview])
        {
            [self.flipToView removeFromSuperview];
            [self.containerView addSubview:mainView];
        }
        else
        {
            [self.mainView removeFromSuperview];
            [self.containerView addSubview:flipToView];
        }

        [UIView commitAnimations];
    }

关于iphone - 翻转由 UINavigationController 管理的 UIViewController 会隐藏导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3432996/

相关文章:

iPhone 崩溃日志?

iphone - 导航栏上未添加点击手势

ios - UIScrollView动态状态栏

IOS ViewController 导航路径 - 如何以编程方式向后导航

ios - 如何显示 View 覆盖另一个 View 并更改 View 大小

ios - 仅在分割 View Controller 的一半上呈现模态视图 Controller

ios - 无法使模态视图出现在 iPad iOS6 的屏幕中央

iphone - 如何从 Objective-C 计算我的应用程序安装日期和设备日期之间的日期计数差异

iphone - 在 Xcode 中以编程方式按下 UITabBar 按钮

ios - 像在 iOS 7 日历应用程序中一样设置 UINavigationBar 高度