2: CAKeyframeAnimation, cakeyframeanimation

Source: Internet
Author: User

2: CAKeyframeAnimation, cakeyframeanimation

It is a subclass of CApropertyAnimation. The difference with CABasicAnimation is that CABasicAnimation can only be changed from one value (fromValue) to another value (toValue), and CAKeyframeAnimation will use an NSArray to save these values, A CALayer attribute can be animated based on a string of values, just like a frame-by-frame animation.

Several key attributes:

  • Values:Is the above NSArray object. The elements are called "key frames" (keyframe ). The animation object will display each key frame in the values array in sequence within the specified time (duration)
  • Path:Set a CGPathRef \ CGMutablePathRef path object. By default, nil is used to move CALayer to the path. Path only applies to the anchorPoint and position of CALayer. If you set path, values will be ignored.
  • KeyTimes:You can specify a time point for the key frame. The value range is 0 to 1.0. Each time value in keyTimes corresponds to each frame in values. when keyTimes is not set, the time of each key frame is equally divided.

Note: CABasicAnimation can be viewed as a CAKeyframeAnimation with a maximum of two key frames.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.