2

我在 UINavigationContoller 上下降了 2 级,已经推送了一些视图。现在,我正在查看其中一个推送视图控制器中的图像,当我点击导航栏中的信息按钮时,我希望子视图翻转而使导航栏保持在原位。如何让子视图(被推送的视图)翻转?现在导航栏也翻转并阻止我导航回到我的堆栈。

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

    [self.imgInfoViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];

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

}
4

1 回答 1

2

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];
    }
于 2010-08-08T03:58:39.523 回答