在启动时显示 UIViewController 以在 UISplitViewController 中显示动画启动屏幕
Present UIViewController at startup for an animating launch screen in UISplitViewController
我有一个用于 rootViewController 的 UISplitViewController!
我不知道如何为动画启动屏幕呈现 UIViewController!
在 AppDelegate.swift 我有:
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let splitViewController = window!.rootViewController as! UISplitViewController
splitViewController.preferredDisplayMode = .allVisible
splitViewController.preferredPrimaryColumnWidthFraction = 1.0
splitViewController.maximumPrimaryColumnWidth = 360
splitViewController.delegate = self
return true
} ...
在哪里以及如何全屏显示 UIViewController "over" UISplitViewController?
在 SplitViewController 内的 ViewController 内,您可以调用:
let newVc = ViewController() //change this to your class name
self.splitViewController?.presentViewController(vc, animated: true, completion: nil)
您可以将 ViewController 设置为 rootViewController 以便 window 以全屏模式显示。之后你可以为 window.
返回 SplitViewController
我有一个用于 rootViewController 的 UISplitViewController!
我不知道如何为动画启动屏幕呈现 UIViewController!
在 AppDelegate.swift 我有:
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let splitViewController = window!.rootViewController as! UISplitViewController
splitViewController.preferredDisplayMode = .allVisible
splitViewController.preferredPrimaryColumnWidthFraction = 1.0
splitViewController.maximumPrimaryColumnWidth = 360
splitViewController.delegate = self
return true
} ...
在哪里以及如何全屏显示 UIViewController "over" UISplitViewController?
在 SplitViewController 内的 ViewController 内,您可以调用:
let newVc = ViewController() //change this to your class name
self.splitViewController?.presentViewController(vc, animated: true, completion: nil)
您可以将 ViewController 设置为 rootViewController 以便 window 以全屏模式显示。之后你可以为 window.
返回 SplitViewController