[英]iOS : Black screen appears when run my app
第 1 步:- 您需要從 info.plist 中刪除場景委托的依賴項(按照 Dipak Ramoliya 上面的 Ans 中的步驟顯示)
第 2 步:- 在場景委托文件中注釋代碼
step 3:- App委托文件中與場景委托相關的注釋代碼(connectingSceneSession方法和sceneSessions方法)
第 4 步:- 在 AppDelegate 文件中添加 window 變量(var window:UIWindow?)
第 5 步:- 在 App Delegate 的 didFinishLaunchingWithOptions 方法中創建 rootViewController
前任:-
let appDelegate = UIApplication.shared.delegate as! AppDelegate
var rootVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "testController") as! TestController
appDelegate.window?.rootViewController = testController
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.