所有选择区段之间有什么区别? [英] What's the difference between all the Selection Segues?

查看:148
本文介绍了所有选择区段之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 显示

  • 显示详细信息

  • 目前模态

  • Popover演示文稿

  • 自定义

  • Show
  • Show Detail
  • Present Modally
  • Popover presentation
  • Custom

它们之间有什么区别?我找不到任何关于它的文件。曾经有一些我在Google搜索中找到的,但它现在已经消失了: https://developer.apple.com/library/ios/recipes/xcode_help-interface_builder/articles-storyboard/StoryboardSegue.html

What is the difference between them? I couldn't find any documentation on it. There used to be some which I found in a Google search, but it's now gone: https://developer.apple.com/library/ios/recipes/xcode_help-interface_builder/articles-storyboard/StoryboardSegue.html

推荐答案

以下是segues的快速摘要和每种类型的示例。

Here is a quick summary of the segues and an example for each type.

显示 - 将目标视图控制器推到导航堆栈上,从右向左滑动,提供返回按钮返回源 - 如果没有嵌入导航控制器,它将以模态方式显示

示例:在Mail中导航收件箱/文件夹

Show - Pushes the destination view controller onto the navigation stack, sliding overtop from right to left, providing a back button to return to the source - or if not embedded in a navigation controller it will be presented modally
Example: Navigating inboxes/folders in Mail

显示详细信息 - 用于拆分视图控制器,替换详细信息/二级视图控制器在扩展的2列接口中,否则如果折叠为1列它将推入导航控制器

示例:在消息中,点击对话将显示对话详细信息 - 在两列布局中替换右侧的视图控制器,或者在单列布局中推送对话

Show Detail - For use in a split view controller, replaces the detail/secondary view controller when in an expanded 2 column interface, otherwise if collapsed to 1 column it will push in a navigation controller
Example: In Messages, tapping a conversation will show the conversation details - replacing the view controller on the right when in a two column layout, or push the conversation when in a single column layout

呈现模态 - 以Presentation选项定义的各种动画时尚呈现视图控制器,覆盖以前的视图控制器 - 最常用于呈现一个视图控制器,从底部开始动画并覆盖iPhone上的整个屏幕,或者在iPad上通常将其显示为居中的框,使呈现视图控制器变暗

示例:选择Touch ID&设置中的密码

Present Modally - Presents a view controller in various animated fashions as defined by the Presentation option, covering the previous view controller - most commonly used to present a view controller that animates up from the bottom and covers the entire screen on iPhone, or on iPad it's common to present it as a centered box that darkens the presenting view controller
Example: Selecting Touch ID & Passcode in Settings

弹出式演示文稿 - 在iPad上运行时,目标位于弹出式窗口中,点击此弹出窗口外的任何位置都会将其忽略,或者支持iPhone弹出框,但默认情况下它会在整个屏幕上以模态方式显示目的地

示例:点击日历中的+按钮

Popover Presentation - When run on iPad, the destination appears in a popover, and tapping anywhere outside of this popover will dismiss it, or on iPhone popovers are supported as well but by default it will present the destination modally over the full screen
Example: Tapping the + button in Calendar

自定义 - 您可以实现自己的自定义segue并控制其行为

Custom - You may implement your own custom segue and have control over its behavior

不推荐的segues是基本上是上述那些的非自适应等价物。这些segue类型在iOS 8中已弃用:推送,模态,弹出,替换。

The deprecated segues are essentially the non-adaptive equivalents of those described above. These segue types were deprecated in iOS 8: Push, Modal, Popover, Replace.

有关详细信息,您可以阅读使用Segues文档,它还解释了segue的类型以及如何在Storyboard中使用它们。另请参阅WWDC 2014的会议216 使用UIKit构建自适应应用程序。他们进行了讨论关于如何使用这些新的自适应分段构建自适应应用程序,他们构建了一个利用这些分段的演示项目。

For more info, you may read over the Using Segues documentation which also explains the types of segues and how to use them in a Storyboard. Also check out Session 216 Building Adaptive Apps with UIKit from WWDC 2014. They talked about how you can build adaptive apps using these new Adaptive Segues, and they built a demo project that utilizes these segues.

这篇关于所有选择区段之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆