Storyboard里面的幾種Segue區別:push,modal,popover,replace和custom


在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類型
 
 
參考資料:
 
使用StoryBoard:用Segue傳遞數據
http://www.cnblogs.com/mybkn/archive/2012/03/22/2411842.html 
 
WWDC2011視頻之Introduction to Storyboarding摘要
http://blog.sina.com.cn/s/blog_834f346f0100s4jr.html
 
storyboard 遇到一個segue的問題
http://www.cocoachina.com/bbs/simple/?t92552.html
 
  


免責聲明!

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



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