2011-08-19 24 views
0

我正在通过更改imageView中心从右向左移动图像。我正在使用NSTimer触发改变中心的事件。除了图像移动不平滑且闪烁之外,一切工作正常。请帮助。从右向左移动图像时闪烁

+0

先给相应的动画'不,我只是用的NSTimer UIImageView' –

回答

1

hm,...但是您确实使用QuartzCore框架为动画制作动画吗? Like in

#import <QuartzCore/QuartzCore.h> 

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:0.3]; // animation duration in seconds 
image.center = view.center; 
[UIView commitAnimations]; 

不是吗? 哦,并确保你在主线程中。 GUI处理其他线程可以产生你不想要的东西;)

+0

触发方法,其中我只是改变由ImageView的中心1px的 – pinku247

0
 Try this code animation flip right to left its definitely help u. 

     #import <QuartzCore/QuartzCore.h> 

     [UIView beginAnimations:nil context:nil]; 
     [UIView setAnimationCurve:UIViewAnimationTransitionFlipFromRight]; 
     [UIView setAnimationDuration:0.3]; // animation duration in seconds 
     image.center = view.center; 
     [UIView commitAnimations];