开发者

A view that is moving

I've no experience in making something move in my app. And I observed this effect in Flickit Pro. The Tap for details view will shake for one or two second and then stop. It looks cute and very user-friendly.

So how can I make effects like this? A gif that is moving? Or some other method开发者_StackOverflows with the help of Cocoa Touch?

Thanks in advance.

Di

A view that is moving


A high-level way would be [UIView beginAnimations: context:] (where both parameters can be NULL in this simple case). Then you can just change the properties that want to change of the view that should be animated, add some other "effects" like ease-in/out, etc. pp. When you are done with this, you just call [UIView commitAnimations] and it will animate everything for you.

However, in the case that you need more freedom, look into the CAAnimation class (its inside the QuartzCore framework).

Also: Look into the documentation for both ways (UIView / CAAnimation) and look into session 424 and 425 of the 2010 WWDC.


There are already some answers on stackoverflow on this:

Shake visual effect on iPhone (NOT shaking the device)

UIView shake animation

how to create iphone's wobbling icon effect?

and here is a link that does it on mac:

http://www.cimgf.com/2008/02/27/core-animation-tutorial-window-shake-effect/

I hope these are enough links to help.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜