打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Xcode6中segue取消原push与modal选项后新增选项的解释

Xcode6中segue取消原push与modal选项后新增选项的解释

2014-11-19本站整理浏览(1790)

Xcode6中segue取消原push与modal选项后新增选项的解释,有需要的朋友可以参考下。


转载请注明出处

答案源于StackOverFlow

push与modal被弃用后,分别被新的show与present modally取代,根据苹果文档,这些新segues更进一步的划分了其适应的类,旧有的push与Modal将仅可用于iOS8以下的版本。

下面链接指向的苹果文档给出了各种可用segues的详细解释,包括新旧各个选项

Adding a Segue Between Scenes in a Storyboard


为避免这个URL在未来发生变化,摘录文档内容如下


Show

根据当前屏幕中的内容,在master area或者detail area中展示内容。

例如:如果app当前同时显示master和detail视图,内容将会压入detail区域。

如果app当前仅显示master或者detail视图,内容则压入当前视图控制器堆栈中的顶层视图。


Show Detail

在detail area中展现内容。

例如:即使app同时显示master和detail视图,那么内容将被压入detail区域

如果app当前仅显示Master或者detail视图,那么内容将替换当前视图控制器堆栈中的顶层视图。


Present Modally

使用模态展示内容。属性面板中提供presentation style (UIModalPresentationStyle)与 transition style (UIModalTransitionStyle)两种选项


Present as Popover

在某个现有视图中的锚点处使用弹出框展示内容。这个选项可指定显示在弹出框视图一边上的箭头可用方向,同时也是指定锚点视图的一个选项。


=======================翻译水平有限,以下是原文====================================

As was mentioned before the "push" and "modal" segues were deprecated, and have been replaced by "show" and "present modally" respectively. According to Apple's documentation, the new segues have been further divided into segues that adapt to size classes. The older ones should only be used to support iOS versions older than iOS 8.

The document in the following link explains that and the description of all the available segues, old and new.

Adding a Segue Between Scenes in a Storyboard

In case the URL changes in the future, this is the explanation given for each new segue:

Show

Present the content in the detail or master area depending on the content of the screen. If the app is displaying a master and detail view, the content is pushed onto the detail area. If the app is only displaying the master or the detail, the content is pushed on top of the current view controller stack.

Show Detail

Present the content in the detail area. If the app is displaying a master and detail view, the new content replaces the current detail. If the app is only displaying the master or the detail, the content replaces the top of the current view controller stack.

Present Modally

Present the content modally. There are options to choose a presentation style (UIModalPresentationStyle) and a transition style (UIModalTransitionStyle).

Present as Popover

Present the content as a popover anchored to an existing view. There is an option to specify the possible directions of the arrow shown on one edge of the popover view (UIPopoverArrowDirection). There is also an option to specify the anchor view.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
IOS 开发基本技能(一)
Storyboard 之segue用法总结 | 学步园
在Storyboard中使用自定义的segue类型 | ryan's blog
Master w/ slave present
ios视图切换之push与present混用
Hello World(GITHUB)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服