由于目前苹果没有支持该功能,所以只能自己在App启动后做一个过度效果:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
UIImageView *splashScreen = [[[UIImageView alloc] initWithFrame:self.window.bounds] autorelease];
splashScreen.image = [UIImage imageNamed:@"Default"];
[self.window addSubview:splashScreen];
[UIView animateWithDuration:1.0 animations:^{
CATransform3D transform = CATransform3DMakeScale(1.5, 1.5, 1.0);
splashScreen.layer.transform = transform;
splashScreen.alpha = 0.0;
} completion:^(BOOL finished) {
[splashScreen removeFromSuperview];
}];
return YES;
}
本文介绍如何在iOS应用启动后实现一个自定义的过渡效果,通过在AppDelegate中添加一个启动画面,并使用UIView动画和CATransform3D进行缩放和透明度调整,使应用启动过程更加流畅美观。
3265

被折叠的 条评论
为什么被折叠?



