iOS 13.2上未显示UITabBar
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
window = UIWindow(frame: UIScreen.main.bounds)
let rootViewController = UITabBarController()
rootViewController.viewControllers = [RecordController()]
window?.rootViewController = rootViewController
window?.makeKeyAndVisible()
return true
}
}iOS 13.2上未显示UINavigationBar
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = UINavigationController(rootViewController: RecordController())
window?.makeKeyAndVisible()
return true
}
}这在iOS 12和更早的版本上非常有效
发布于 2020-02-12 13:22:46
如果您使用的是13.2,则需要替换场景代理中的代码。如果xcode中没有场景委托,则在didFinishLaunchingWithOptions委托中使用此条件。
希望它能为你工作。谢谢
if #available(iOS 13, *) {
return //code for ios 13
} else {
return // code for ios 12 or lower version
}https://stackoverflow.com/questions/60180338
复制相似问题