【发布时间】:2020-05-11 06:39:23
【问题描述】:
revealingSplashView 有问题。我希望每次应用启动时都显示它,但它没有显示,因为我必须将它添加为 Subview,但我怎样才能在 AppDelegate 中做到这一点?
我试过了,但它不起作用:
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let revealingSplashView = RevealingSplashView(iconImage: UIImage(named: "zauberstab")!, iconInitialSize: CGSize(width: 120, height: 120), backgroundColor: .white)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print("hi")
revealingSplashView.startAnimation()
window?.addSubview(revealingSplashView)
FirebaseApp.configure()
return true
}
【问题讨论】:
-
window?.rootViewController?.view.addSubview(revealingSplashView)? -
工作就像一个魅力,谢谢:)
-
酷,我会给出这个答案。
标签: ios swift uiview appdelegate subview