2017-09-01 32 views
0

我面臨一個問題,同時提出ViewControllerNavigation.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?

感謝

+0

嘗試改變這一行'的AppDelegate .shared()窗口.rootViewController .present(視圖 - 控制,動畫:真,完成:無)。?''到AppDelegate中.shared()窗口? .rootViewController?.present(nav,animated:true,completion:nil)' – Amit

+0

提供導航控制器而不是ViewController – Hiren

+0

試試這個:UIApplication.shared.keyWindow?.rootViewController?.present(alert,animated:true,completion:nil ) – Ishika

回答

1

身份檢查檢查你設置爲「viewIdentifire」故事板標識?

爲了更好的理解,請檢查附加的截圖。您將在Identity Inspector中找到此標識

enter image description here

+0

它應該是評論 –

+0

@MikeAlter我如何在評論中放置截圖?請檢查我已經附上的截圖。 – shahnilay86

+0

我明白了,你不能在屏幕上放置評論,但是這裏並不需要屏幕截圖。請記住,你正在回答未來讀者的問題, –

相關問題