segue場景跳轉的使用總結


a>iOS8之前的storyboard segue:

在storyboard中,segue有幾種不同的類型,在iphone和ipad的開發中,segue的類型是不同的。

在iphone中,segue有:push,modal,和custom三種不同的類型,這些類型的區別在與新頁面出現的方式。

而在ipad中,有push,modal,popover,replace和custom五種不同的類型。

 

modal: 

最常用的場景,新的場景完全蓋住了舊的那個。用戶無法再與上一個場景交互,除非他們先關閉這個場景。

是在viewController中的標准切換的方式,包括淡出什么的,可以選切換動畫。

Modalview:就是會彈出一個view,你只能在該view上操作,而不能切換到其他view,除非你關閉了modalview.

Modal View對應的segue type就是modal segue

*Modal:Transition to another scene for the purposes of completing a task.user在彈出的modalview里操作完后,就應該dismiss the modal view scene然后切換回the originalview.

 

push:

Push類型一般是需要頭一個界面是個Navigation Controller的。

是在navigation View Controller中下一級時使用的那種從右側划入的方式

*Push:Create a chain of scenes where the user can move forward or back.segue type是和navigation viewcontrollers一起使用。

 

popover(iPad only)

popover 類型,就是采用浮動窗的形式把新頁面展示出來

*Popover(iPad only):Displays the scene in a pop-up “window” over top of the current view.

 

replace (iPad only):

替換當前scene

Replace the current scene with another. This is used in some specialized iPad viewcontrollers (e.g. split-view controller).

 

custom

就是自定義跳轉方式啦。

*Custom:Used for programming a customtransition between scenes.

Storyboard中使用自定義的segue類型

 

b>iOS8之后的storyboard segue:

1Action Segue:

show: 在master或detail區域展現內容(典型的如iPad的設置界面,左側是master,右側是detail),究竟是在哪個區要取決於屏幕上的內容,如果不分master/detail,就單純的把新的內容push到當前view controller stack的頂部

例如:如果app當前同時顯示master和detail視圖,內容將會壓入detail區域。

    如果app當前僅顯示master或者detail視圖,內容則壓入當前視圖控制器堆棧中的頂層視圖。

show detail: 在master或detail區域展現內容(典型的如iPad的設置界面,左側是master,右側是detail),究竟是在哪個區要取決於屏幕上的內容,如果不分master/detail,就單純的把新的內容push到當前view controller stack的頂部

例如:即使app同時顯示master和detail視圖,那么內容將被壓入detail區域

    如果app當前僅顯示Master或者detail視圖,那么內容將替換當前視圖控制器堆棧中的頂層視圖。

present modally:模態展示內容

 使用模態展示內容。屬性面板中提供presentation style (UIModalPresentationStyle)與 transition style (UIModalTransitionStyle)兩種選項

popover presentation:在當前的view上出現一個小窗口來展示內容,無處不在的“選中文字后出現 復制/翻譯 按鈕

在某個現有視圖中的錨點處使用彈出框展示內容。這個選項可指定顯示在彈出框視圖一邊上的箭頭可用方向,同時也是指定錨點視圖的一個選項。

custom:自定義

 

2、Non-adaptive Action Segue:

push (deprecated):取消的

modal (deprecated):取消的

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM