UIImageView *v12=[[UIImageView alloc] initWithFrame:CGRectMake(320,80, 100, 84)];
UIImage*image2=[UIImage imageNamed:@"nvwu.png"];
v12.image=image2;
[self.view addSubview:v12];
UIImageView *v13=[[UIImageView alloc] initWithFrame:CGRectMake(320,80, 50, 42)];
UIImage*image3=[UIImage imageNamed:@"nvwu1.png"];
v13.image=image3;
[self.view addSubview:v13];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:4];
v13.frame=CGRectMake(120,80, 100, 84);
//动画结束
CATransition *animation = [CATransition animation];
//动画时间
animation.duration = 2.0f;
//先慢后快
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
//animation.removedOnCompletion = NO;
//[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];//oglFlip, fromRight
// animation.type=kCATransitionFade;
[UIView commitAnimations];
v13.image=image2;
[v13 setAlpha:0.3];
//下边是嵌套使用,先变大再消失的动画效果.
[UIView animateWithDuration:1.8 animations:^{
CGAffineTransform newTransform = CGAffineTransformMakeScale(1.2, 1.2);
[v13 setTransform:newTransform];}
completion:^(BOOL finished){
[UIView animateWithDuration:0.8 animations:^{
[v13 setAlpha:1];} completion:^(BOOL finished){
}];
}];
UIImage*image2=[UIImage imageNamed:@"nvwu.png"];
v12.image=image2;
[self.view addSubview:v12];
UIImageView *v13=[[UIImageView alloc] initWithFrame:CGRectMake(320,80, 50, 42)];
UIImage*image3=[UIImage imageNamed:@"nvwu1.png"];
v13.image=image3;
[self.view addSubview:v13];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:4];
v13.frame=CGRectMake(120,80, 100, 84);
//动画结束
CATransition *animation = [CATransition animation];
//动画时间
animation.duration = 2.0f;
//先慢后快
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
//animation.removedOnCompletion = NO;
//[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];//oglFlip, fromRight
// animation.type=kCATransitionFade;
[UIView commitAnimations];
v13.image=image2;
[v13 setAlpha:0.3];
//下边是嵌套使用,先变大再消失的动画效果.
[UIView animateWithDuration:1.8 animations:^{
CGAffineTransform newTransform = CGAffineTransformMakeScale(1.2, 1.2);
[v13 setTransform:newTransform];}
completion:^(BOOL finished){
[UIView animateWithDuration:0.8 animations:^{
[v13 setAlpha:1];} completion:^(BOOL finished){
}];
}];