如何在iPhone上定期启动应用程序(在HomeScreen上推送应用程序图标)时复制“向上扩展动画” [英] How to replicate the Scale Up Animation when an app starts regularly (push app icon on HomeScreen) on an iPhone

查看:137
本文介绍了如何在iPhone上定期启动应用程序(在HomeScreen上推送应用程序图标)时复制“向上扩展动画”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iPhone上启动应用程序时复制动画。
我认为第一个视图从50%扩大到100%。
后来我想用它作为2个视图之间的过渡。
任何想法如何复制,或者在sdk中是否有苹果准备使用的解决方案?
非常感谢:)

i want to replicate the animation when an app starts on iPhone. There is the first view scaling up from 50 % to 100% i think. later I want to use this as a transition between 2 views. Any ideas how to replicate, or is there a ready to use solution from apple in the sdk? Thank you very much :)

推荐答案

你可以用CABasicAnimation和CAAnimationGroup做同样的事情,我实际上认为UIKit Animations上的核心动画更加流畅,它可以让您获得更多控制权。

You can do the same thing with CABasicAnimation and CAAnimationGroup, I actually thought that Core Animation over UIKit Animations was smoother and It gives you more control.

CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
animationGroup.removedOnCompletion = YES;

CABasicAnimation *fadeAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
fadeAnimation.fromValue = [NSNumber numberWithFloat:0.0];
fadeAnimation.toValue = [NSNumber numberWithFloat:1.0];

CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scaleAnimation.fromValue = [NSNumber numberWithFloat:0.5];
scaleAnimation.toValue = [NSNumber numberWithFloat:1.00];

animationGroup.animations = [NSArray arrayWithObjects:fadeAnimation, scaleAnimation, nil];

[self.layer addAnimation:animationGroup forKey:@"fadeAnimation"];
self.layer.opacity = 1.0;

总有一种方法可以给猫皮肤

"There's always more then one way to skin a cat"

这篇关于如何在iPhone上定期启动应用程序(在HomeScreen上推送应用程序图标)时复制“向上扩展动画”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆