[英]UIViewController default transition animation not working
我想呈現viewController
的模態navigationController
,然后按陸續視圖x-seconds
,但由於某些原因,在first
和second view
都沒有動畫呈現。 我試圖在主線程上dispatch UI
與dispatch UI
相關的代碼,但沒有解決該錯誤。
我先對兩個視圖都使用navigationController.setViewControllers([vc]), animated: true)
,然后再使用rootViewController.present(navigationController, animated: true)
,
知道為什么動畫丟失了嗎?
嘗試使用
Self.layoutIfNeeded()
當以present modally
,應該presentViewController
方法。 當push
入navigationController
,應使用pushViewController
。 如果你想present
第一,說VC1
目前NC2
(有VC2根)。 然后,您應該使用NC2
來pushViewController
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.