2011-01-27 105 views
0

我試圖讓UIImage有輕微的浮動效果。uiimage動畫效果

[UIView setAnimationDelegate:self]; 
      [UIView setAnimationDidStopSelector:@selector(endSwipeAnimation)]; 
      [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; 
      [UIView setAnimationRepeatCount:10]; 
      [myImage setAlpha:1.0]; 
      [myImage setAlpha:0.7]; 

      [UIView setAnimationRepeatAutoreverses:NO]; 

      [UIView commitAnimations]; 

任何想法如何做到這一點?

在此先感謝

+0

你可以發佈一個短暫的視頻剪輯,說明目前正在做什麼,並且更好地描述你想要做什麼? – 2011-01-27 11:29:50

回答

0
[UIView beginAnimations:animationID context:context]; 
[UIView setAnimationDuration:duration]; 

失蹤......?

1

在動畫之間寫下你想要的新效果或改變。

首先將imageView alpha值設置爲1 ,然後將其alpha值更改爲0.5或任何你想要的動畫。

+0

[UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(endSwipeAnimation)]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; [UIView setAnimationRepeatCount:10]; [myImage setAlpha:0.7]; [UIView setAnimationRepeatAutoreverses:NO]; [UIView commitAnimations]; – 2012-11-28 12:31:30