我需要按一下按钮或任务完成时,弹出&倾斜动画到UIView
。闪光/闪烁UIView
大多数应用于UIView
动画的时候都添加或删除从UIView
通常应用于但如何实现这一目标,以期已添加到查看。
动画可以是任何东西,只要它吸引用户的注意力(表明任务已完成)。
我需要按一下按钮或任务完成时,弹出&倾斜动画到UIView
。闪光/闪烁UIView
大多数应用于UIView
动画的时候都添加或删除从UIView
通常应用于但如何实现这一目标,以期已添加到查看。
动画可以是任何东西,只要它吸引用户的注意力(表明任务已完成)。
编辑How to scale and rotate a view in a single animation
您可能需要使用核心动画和组中添加两个动画:
CABasicAnimation *stetchAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"];
stetchAnimation.toValue = [NSNumber numberWithDouble:(someView.frame.size.width+100)/someView.frame.size.width];
CABasicAnimation *skewAnimation = CABasicAnimation animationWithKeyPath:@"transform.rotation.x"];
stetchAnimation.toValue:[NSNumber numberWithInt:180];
//Add both animation at time when task is completed
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
animationGroup.animations = [NSArray arrayWithObjects:stetchAnimation,skewAnimation,nil];
animationGroup.removedOnCompletion = YES;
animationGroup.fillMode = kCAFillModeForwards;
animationGroup.duration = 0.7; // increase duration if needed
[someView.layer addAnimation:animationGroup forKey:@"animations"];
当最后一行被执行时,即动画被添加到图层,视图是否会开始动画,或者我是否还需要做其他操作。 – tGilani 2012-08-13 05:48:15
是的,它会开始动画 – 2012-08-13 06:16:50
http://stackoverflow.com/questions/9341332/how-to-scale-and-rotate-a-view-in-a-single-animation – 2012-08-13 06:47:49
简单的UIView动画;暂时增长的观点:
[UIView animateWithDuration:0.3 animations:^{
CGRect frm = view.frame;
frm.size.width += 20;
frm.size.height += 20;
frm.origin.x -= 10;
frm.origin.y -= 10;
view.frame = frm;
} completion:^{
[UIView animateWithDuration:0.3 animations:^{
CGRect frm = view.frame;
frm.size.width -= 20;
frm.size.height -= 20;
frm.origin.x += 10;
frm.origin.y += 10;
view.frame = frm;
}];
}];
那么它是拉伸&歪斜或闪光? – 2012-08-13 05:31:33
任何动画都会执行:) – tGilani 2012-08-13 05:45:58