2010年4月10日土曜日

UIViewアニメーション

animeViewを0.1から1.5の大きさにするアニメーション


[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.5f]; //1.5秒でアニメーションする
[UIView setAnimationCurve:UIViewAnimationCurveLinear];//等速度で進行します
[UIView setAnimationDelegate:self]; //デリゲート
[UIView setAnimationDidStopSelector:@selector(someAnimationDidStop:finished:context:)]; // アニメーション終了後
[UIView setAnimationRepeatAutoreverses:YES]; // リバース動作
CGAffineTransform transform1 = CGAffineTransformMakeScale(0.1, 0.1);
CGAffineTransform transform2 = CGAffineTransformMakeScale(1.5, 1.5);
[self.animeView setTransform:transform1];
[self.animeView setTransform:transform2];
[UIView commitAnimations];// 終わり

//アニメーション完了のイベント処理
- (void)someAnimationDidStop:(NSString*)animationID finished:(BOOL)finished context:(void*)duration {
NSLog(@"アニメーション完了");
}



参考文献------
スマッシュを作ってみた(1)
『支出管理』サポート
UIViewで手軽にアニメーションを実行する方法
iPhoneSDKのUIViewアニメーション

0 件のコメント:

コメントを投稿