iphone - 导航栏 + presentModalViewController

标签 iphone objective-c uinavigationcontroller transition

我有一个基于导航栏的应用程序,在应用程序的一个特定位置,我在导航栏上有一个按钮,该按钮应该使用翻转过渡呈现一个新 View (本质上是将用户从表格 View 带到 map View ) .我目前正在使用

 DetailLocationView *detailLocationView = [DetailLocationView alloc] init];
 detailLocationView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
 [self.view presentModalViewController:detailLocationView animated:YES];
 [detailLocationView release];

此代码获取用户所在的整个 View (导航栏和表格 View )并将其翻转到 detailLocationView 中。但是,我希望 detailLocationView 仍然有一个导航栏。我想知道加载 detailLocationView 的最佳方式是什么,以便它具有翻转过渡并且仍然具有导航栏。

谢谢

最佳答案

pushViewController 而不是 presentModalViewController 将保留导航栏,但不会如您所愿。

如果您想“翻转”并仍然拥有导航栏 - 您必须使用导航栏翻转到新 View 。不过,从 UI 的角度来看,这有点不合逻辑 - 即当您目视看到 View 翻转时 - 您会看到它变成了完全不同的东西 - 所以 View 翻转然后显示相同导航栏可能有点困惑。

关于iphone - 导航栏 + presentModalViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3999854/

相关文章:

iPhone - NSDictionary 到 NSArray 并保留顺序

objective-c - UITableViewCell 选择 Storyboard segue 很慢 - 虽然双击可以工作

ios - 如何在休息套件中解析此响应?

iphone - 每次都收到当前位置的警报

ios 7自定义转换不适用于导航 Controller

ios - 在 UINavigationController 中添加一个 UISegmentedControl 作为 titleView

iphone - Objective C 如何将文本字段添加到导航栏中

iphone - 存档 Ipad 应用程序?

iphone - 应用程序在后台崩溃,而蓝牙连接长时间丢失

ios - 推送 View Controller 时无缝动画 "from left to right"?