ios - 通过 UINavigationController 进行 segue 的优势

标签 ios objective-c iphone swift

在从一个 ViewControllerViewController 的 segue 之间使用 UINavigationController 有什么好处?

没有 UINavigationController 也可以做到。并分别添加导航栏和返回按钮

enter image description here

最佳答案

在从一个 ViewController 到 ViewController 的 segue 之间使用 UINavigationController 的优点是您可以使用 UINavigationItem 返回上一个 ViewController。

像这样,

enter image description here

这就是您不需要实现转换的原因。但这是原因之一。

如果你想了解更多关于 UINavigationController 的细节,你可以看看。

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/

UINavigationController 中有很多有用的方法。

因此,使用 UINavigationController 的 segue 还是只使用 segue 哪个更好取决于您的情况。如果您不知道哪个更好,请在 stackoverflow 中再次提问。

关于ios - 通过 UINavigationController 进行 segue 的优势,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32334006/

相关文章:

iphone - iOS 4.3 上的图像负畸变

ios - 如何使用 Objective C 根据设备方向更改 UIView 约束?

iphone - 在未初始化的对象(空指针)上调用方法

objective-c - 如何在 Swift 中使用 NSSet<Class>(导出为 Set<NSObject>)?

ios - TableViewCell 问题上的 MapView

javascript - CSS 动画仅在 iPad 上导致 Phonegap App 崩溃

html - 在ionic中设置默认 View

iphone - 在特定时间向 iPhone 发送当前位置

iphone - 使用自定义 TTPhotoView 扩展 TTPhotoViewController

iOS 应用内购买。识别购买的产品(非消耗品)。