开发者

Oscillating View Animation

开发者 https://www.devze.com 2023-01-27 13:53 出处:网络
Can some one please guide me how to create an Oscillation Animation on an ImageView. I have a tag image and i wan开发者_开发百科t to animate it..

Can some one please guide me how to create an Oscillation Animation on an ImageView.

I have a tag image and i wan开发者_开发百科t to animate it..

any code snippets of CABasicAnimation for it???


You could use:

+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay 
options:(UIViewAnimationOptions)options animations:(void (^)(void))animations 
completion:(void (^)(BOOL finished))completion

And use the Ease in and Ease out transitions to accelerate and decelerate toward the end.

Note: the blocks based animation is only valid in is 4.0 and later if you want earlier you need to use

+ (void)beginAnimations:(NSString *)animationID context:(void *)context

And its a simple matter of editing the frame of the view.

0

精彩评论

暂无评论...
验证码 换一张
取 消