为iOS App增加启动渐变效果
2014-02-16 23:24
519 查看
转自:http://blog.csdn.net/jasonblog/article/details/8029081
由于目前苹果没有支持该功能,所以只能自己在App启动后做一个过度效果:
[cpp] view
plaincopy
- (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;
}
由于目前苹果没有支持该功能,所以只能自己在App启动后做一个过度效果:
[cpp] view
plaincopy
- (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 App增加启动渐变效果
- 为iOS App增加启动渐变效果
- 为iOS App增加启动渐变效果
- 为iOS App增加启动渐变效果
- 为iOS App增加启动渐变效果
- 为iOS App增加启动动画效果
- iOSAPP启动效果复杂动画之抽丝剥茧
- 实测iOS Dynamic Framework 对 App 启动时间的影响效果
- 用动画实现android app启动界面的渐变效果
- iOS纯Autolayout实现微信朋友圈和通讯录另附App启动页短视频效果
- UITableView下拉色彩渐变,图片变大效果(模仿链家网iOS APP首页)
- Android开发_app启动界面背景渐变效果
- ios app启动图片,之后的广告图片效果
- iOSAPP启动效果复杂动画之抽丝剥茧
- iOS中app启动闪退的原因
- iOS App图标和启动画面尺寸
- Facebook iOS App如何优化启动时间
- 判断IOS APP是否第一次启动
- 怎样编写代码在iOS App中添加动态启动画面