溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

ios開發--模態視圖

發布時間:2020-06-22 14:16:59 來源:網絡 閱讀:1273 作者:zmhot88 欄目:移動開發

         一個視圖控制器用另一個視圖控制器的視圖取代它自己的視圖。這就是模態(modal)視圖。

         A modal view (that is, a view presented modally) provides self-contained functionality in the context of the current task or workflow.

         明顯的,模態視圖打斷了當前的視圖堆棧,新生成了一個視圖,這個視圖當然也是有視圖控制器的,你可以這么使用模態視圖:

  • Use them to gather information from the user immediately.

  • Use them to present some content temporarily.

  • Use them to change work modes temporarily.

  • Use them to implement alternate interfaces for different device orientations.

  • Use them to present a new view hierarchy with a specific type of animated transition (or no transition).

          任何視圖控制器都可以成為模態視圖控制器。模態視圖和普通視圖之間的差異:

ios開發--模態視圖

還是有些小差異的。

        模態視圖的兩個參數:

modalTransitionStyle

      UIModalTransitionStyleCoverVertical

      UIModalTransitionStyleFlipHorizontal

      UIModalTransitionStyleCrossDissolve

      UIModalTransitionStylePartialCurl

modalPresentationStyle

      UIModalPresentationFullScreen

      UIModalPresentationPageSheet

      UIModalPresentationFormSheet

      UIModalPresentationCurrentContext

這兩個參數是指過渡方式和最終的呈現方式。

        模態視圖和顯示出它的視圖之間存在父子關系,一般都是通過父視圖來顯示和關閉:

        presentModalViewController:controller    animated:YES

        dismissModalViewControllerAnimated:YES

 

模態視圖控制器和UIPopoverController的主要不同是用戶必須響應模態視圖。

 

模態對話框主要有UIAlertView, UIActionSheet, UILocalNotification。這個就不一一贅述了。

 

關于模態視圖其實有個最重要的問題是:為什么稱為模態?還沒想明白。

 

 

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女