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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章