在我的应用程序中,我希望启动画面能够动画显示。我使用了以下代码,但是动画没有生效。
UIImageView *splashScreen = [[UIImageView alloc] initWithImage:[UIImage imageNamed: @"Default.png"]];
[self.window.rootViewController.view addSubview: splashScreen];
[self.window makeKeyAndVisible];
NSLog(@"begin splash");
[UIView animateWithDuration: 0.2
delay: 0.5
options: UIViewAnimationOptionCurveEaseOut
animations: ^{splashScreen.alpha = 0.0;
}
completion: ^ (BOOL finished) {
[splashScreen removeFromSuperview];
NSLog(@"end splash");
}
];