我面臨一個問題,同時提出ViewController
與Navigation.TabbarController
是我的應用程序的Rootview
。我已經使用BATabbarController
,但是當我提出viewController
與導航,它與黑色的背景介紹Viewcontroller提出問題
let viewcontroller = UIStoryboard(name:"Main", bundle: nil).instantiateViewController(withIdentifier: "viewIdentifire") as! ViewController
let nav = UINavigationController(rootViewController: viewcontroller)
AppDelegate .shared().window?.rootViewController?.present(viewcontroller, animated: true, completion: nil)
我提出控制器形式AppDelegates窗口
任何人有任何想法,爲什麼這happnes?
感謝
嘗試改變這一行'的AppDelegate .shared()窗口.rootViewController .present(視圖 - 控制,動畫:真,完成:無)。?''到AppDelegate中.shared()窗口? .rootViewController?.present(nav,animated:true,completion:nil)' – Amit
提供導航控制器而不是ViewController – Hiren
試試這個:UIApplication.shared.keyWindow?.rootViewController?.present(alert,animated:true,completion:nil ) – Ishika