IOS 动画那点事

IOS 动画分为两个部分:

1.

2.core animation

Animations
Changes to several view properties can be animated—that is, changing the property creates an animation that conveys the change to the user over a short period of time. The UIView class does most of the work of performing the actual animations but you must still indicate which property changes you want to be animated. There are two different ways to initiate animations:

In iOS 4 and later, use the block-based animation methods. (Recommended)
Use the begin/commit animation methods.
The block-based animation methods (such as animateWithDuration:animations:) greatly simplify the creation of animations. With one method call, you specify the animations to be performed and the options for the animation. However, block-based animations are available only in iOS 4 and later. If your application runs on earlier versions of iOS, you must use the beginAnimations:context: and commitAnimations class methods to mark the beginning and ending of your animations.

The following properties of the UIView class are animatable:

  @property frame
  @property bounds
  @property center
  @property transform
  @property alpha
  @property backgroundColor
  @property contentStretch
For more information about how to configure animations, see

设置动画类型:

typedef enum {
    UIViewAnimationCurveEaseInOut,         // slow at beginning and end
    UIViewAnimationCurveEaseIn,            // slow at beginning
    UIViewAnimationCurveEaseOut,           // slow at end
    UIViewAnimationCurveLinear
} UIViewAnimationCurve;

猜你喜欢

转载自xiaoxuejie.iteye.com/blog/1673804