![](/img/trans.png)
[英]In iOS 11, dismissing a modally presented navigation controller results in visual duplication
[英]iOS dismissing a modally presented Navigation Controller
我以這種方式介紹導航控制器:
let navController = self.storyboard?.instantiateViewControllerWithIdentifier("myId") as! UINavigationController
self.presentViewController(navController, animated: true, completion: nil)
如何使用情節提要中設置的Navigation Bar Button
關閉此Navigation Controller
? 可能嗎?
注意:我不是在問如何關閉VC的邏輯,我知道protocol/delegate
模式。 相反,我問我是否可以在導航欄中放置"Cancel"
按鈕,以及該按鈕的IBAction
是否在Navigation Controller
子類中或在navcontroller的根視圖控制器中聲明。
UINavigationController
不擁有導航欄按鈕項。 它由視圖控制器提供,並推入堆棧。 您可以從視圖控制器的任何導航欄中關閉UINavigationController
,前提是它是以模態顯示的。 可以在情節UINavigationBar
中添加UINavigationBar
,並為執行IBOutlet
的條形按鈕項提供IBOutlet
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.