翻转由 UINavigationController 管理的 UIViewController 会隐藏导航栏
我已经在 UINavigationContoller 上降低了 2 个级别,并且已经推送了一些视图。现在,我正在查看其中一个推送视图控制器内的图像,当我点击导航栏中的信息按钮时,我希望子视图翻转,将导航栏保留在原位。如何让子视图(被推送的视图)翻转?现在,导航栏也会翻转并阻止我导航回堆栈。
-(void)showImageInfo
{
self.imgInfoViewController = [[ImageInfoViewController alloc] initWithNibName:@"ImageInfoViewController" bundle:nil];
[self.imgInfoViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self.navigationController presentModalViewController:self.imgInfoViewController animated:YES];
}
I'm 2 levels down on a UINavigationContoller having already pushed a few views. Now I'm looking at an image inside one of the pushed view controllers and when I tap an info button in the navigation bar, I want the sub view to flip leaving the nav bar in place. How do I get just the subview (the view that was pushed) to flip? Right now the nav bar also flips and prevents me from navigating back up my stack.
-(void)showImageInfo
{
self.imgInfoViewController = [[ImageInfoViewController alloc] initWithNibName:@"ImageInfoViewController" bundle:nil];
[self.imgInfoViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self.navigationController presentModalViewController:self.imgInfoViewController animated:YES];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 UICatalog 示例的代码...我认为它会满足您的需求。基本上你必须做更多的编码才能获得翻转行为。
http://developer.apple.com/iphone/library/samplecode/UICatalog/Listings/TransitionViewController_m.html#//apple_ref/doc/uid/DTS40007710-TransitionViewController_m-DontLinkElementID_34
code from UICatalog Example.... I think it will do what you are looking for. Basically you have to do some more coding to get the flip behavior.
http://developer.apple.com/iphone/library/samplecode/UICatalog/Listings/TransitionViewController_m.html#//apple_ref/doc/uid/DTS40007710-TransitionViewController_m-DontLinkElementID_34