2011-01-27 108 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