Xcode6中segue弃用push与modal选项后新增的解决办法

正如提及到的push, modal被弃用,Apple给出了相应的替代方法“show”和“present modally”。根据苹果官方文档,新的segues更能区分适应不同的类。新增的方法只能用于IOS8及以上版本。

下面链接解释了新老版本的segues全部方法

Adding aSegue Between Scenes in a Storyboard

为了防止这个URL在未来发生变化,现摘录每一个新的segue如下:

在的master还是detail中显示内容,取决于当前的Screen中的内容

Show:

            1,  如果app同时显示master和detail两个,那么内容将压入detail区。

Show  detail

            2,  如果app仅仅显示master或者detail,那么内容将替换掉当前view controller栈的栈顶成员。

Present modally

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

Present as Popover

            在当前正在执行的View上弹出内容页作为一个锚点,这个选项指出了弹出视图边缘的箭头的可用方向。这也是指定锚点视图的一个选项。


-------------英文水平有限-------------以上内容仅供参考----------------原文如下----------------如遇明显错误请留言------------------谢谢------------------------


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.


发布了23 篇原创文章 · 获赞 2 · 访问量 7万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章