- (void)loadView {[super loadView];//イメージビュー產生_imageView=[[UIImageView alloc] init];UIImage* image=[UIImage imageNamed:@"image.jpg"];[_imageView setImage:image];[_imageView setFrame:CGRectMake(0,0,image.size.width,image.size.height)];[self.view addSubview:_imageView];[self testAnimetion];}- (void) testAnimetion {//アニメーションの開始[UIView beginAnimations:@"testAnimation" context:NULL];[UIView setAnimationDuration:0.1f]; // 時間[UIView setAnimationCurve:UIViewAnimationCurveLinear]; // 加速パターン[UIView setAnimationDelegate:self]; // デリゲート[UIView setAnimationRepeatAutoreverses:TRUE];// リバース動作[UIView setAnimationRepeatCount:999]; // 繰り返し回數[UIView setAnimationDidStopSelector:@selector(animationDidStop:)];//イメージの移動CGRect frame=_imageView.frame;frame.origin.x=50; // xが 0〜50 まで移動_imageView.frame=frame;_imageView.alpha=0; // 透明度を0に//アニメーションの終了[UIView commitAnimations];}