翻轉(zhuǎn)動(dòng)畫
//開始動(dòng)畫
[UIView beginAnimations:@"doflip" context:nil];
//設(shè)置時(shí)常
[UIView setAnimationDuration:1];
//設(shè)置動(dòng)畫淡入淡出
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
//設(shè)置代理
[UIView setAnimationDelegate:self];
//設(shè)置翻轉(zhuǎn)方向
[UIView setAnimationTransition:
UIViewAnimationTransitionFlipFromLeft ?forView:manImageView cache:YES];
//動(dòng)畫結(jié)束
[UIView commitAnimations];
旋轉(zhuǎn)動(dòng)畫
//創(chuàng)建一個(gè)CGAffineTransform ?transform對(duì)象
CGAffineTransform ?transform;
//設(shè)置旋轉(zhuǎn)度數(shù)
transform = CGAffineTransformRotate(manImageView.transform,M_PI/6.0);
//動(dòng)畫開始
[UIView beginAnimations:@"rotate" context:nil ];
//動(dòng)畫時(shí)常
[UIView setAnimationDuration:2];
//添加代理
[UIView setAnimationDelegate:self];
//獲取transform的值
[manImageView setTransform:transform];
//關(guān)閉動(dòng)畫
[UIView commitAnimations];
偏移動(dòng)畫
[UIView beginAnimations:@"move" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationDelegate:self]惫叛;
//改變它的frame的x,y的值
manImageView.frame=CGRectMake(100,100, 120,100);
[UIView commitAnimations];
翻頁動(dòng)畫
[UIView beginAnimations:@"curlUp" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];//指定動(dòng)畫曲線類型,該枚舉是默認(rèn)的逞刷,線性的是勻速的
//設(shè)置動(dòng)畫時(shí)常
[UIView setAnimationDuration:1];
[UIView setAnimationDelegate:self];
//設(shè)置翻頁的方向
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:manImageView cache:YES];
//關(guān)閉動(dòng)畫
[UIView commitAnimations];
縮放動(dòng)畫
CGAffineTransform ?transform;
transform = CGAffineTransformScale(manImageView.transform,1.2,1.2);
[UIView beginAnimations:@"scale" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationDelegate:self];
[manImageView setTransform:transform];
[UIView commitAnimations];
取反的動(dòng)畫效果是根據(jù)當(dāng)前的動(dòng)畫取他的相反的動(dòng)畫
CGAffineTransform transform;
transform=CGAffineTransformInvert(manImageView.transform);
[UIView beginAnimations:@"Invert" context:nil];
[UIView setAnimationDuration:2];//動(dòng)畫時(shí)常
[UIView setAnimationDelegate:self];
[manImageView setTransform:transform];//獲取改變后的view的transform
[UIView commitAnimations];//關(guān)閉動(dòng)畫