IOS transition Animations

Source: Internet
Author: User

inherits from caanimation&nb Sp;: nsobject
conforms to nscoding (caanimation)
nscopying (caanimation)
caaction ( caanimation)
camediatiming (caanimation)
nsobject (nsobject)
framework /system/library/fra Meworks/quartzcore.framework
availability Available in IOS 2.0 and later.
declared in caanimation.h

The Catransition class implements the transition animation for the layer. You can specify transition effects from a set of predefined transformations or by providing a custom cifilter instance.

[Plain]View Plaincopy
  1. Define a transition animation
  2. Catransition *animation = [catransition animation];
  3. Transition animation Duration
  4. Animation.duration = 0.2f;
  5. Timing function, from beginning to end fluency???
  6. Animation.timingfunction=uiviewanimationcurveeaseinout;
  7. Transition animation Type
  8. Animation.type = Kcatransitionreveal;
  9. The direction the transition animation will go
  10. Animation.subtype = Kcatransitionfrombottom;
  11. The implementation you need when animating
  12. Self.tabBarController.tabBar.hidden = YES;
  13. Add animations (transition animations are animations added on a layer)
  14. Self.tabBarController.tabBar.layer addanimation:animation forkey:@ "animation"];



Description

duration: How long the animation lasts.

timingfunction: I don't understand (who understands that)

Type: Types of transition animations. If you specify a filter property in a custom transition animation, this property is ignored.

There are four types of type:

NSString * Const kcatransitionfade;//gradually disappears NSString * Const kcatransitionmovein;//MOVE in NSString * Const kcatransitionpush;// Translate (so call it) NSString * Const kcatransitionreveal;//revealed

The default type is Kcatransitionfade.

subtype: The direction in which the transition animation will go.

There are four types of Subtpye:

NSString * Const kcatransitionfromright; NSString * Const Kcatransitionfromleft; NSString * Const Kcatransitionfromtop; NSString * Const Kcatransitionfrombottom;

The default direction is nil.

[Self.tabBarController.tabBar.layer addanimation:animation forkey:@ "animation"];

transition animations are added to the layer!

The following several transition animation calls the Apple's private API, note, carefully used after the Apple called back.

[Plain]View Plaincopy
  1. Switch (Btn.tag) {
  2. Case 0:
  3. Animation.type = @ "cube";//---Cube
  4. Break
  5. Case 1:
  6. Animation.type = @ "Suckeffect";//103 suck-away effect
  7. Break
  8. Case 2://before and after rollover effect
  9. Animation.type = @ "Oglflip";//when subtype is "Fromleft" or "fromright", it ' s the official one.
  10. Break
  11. Case 3:
  12. Animation.type = @ "Rippleeffect";//110 Ripple Effect
  13. Break
  14. Case 4:
  15. Animation.type = @ "Pagecurl";//101 page Up
  16. Break
  17. Case 5:
  18. Animation.type = @ "Pageuncurl";//102 PAGE Down
  19. Break
  20. Case 6:
  21. Animation.type = @ "Camerairishollowopen";//107//Lens Open
  22. Break
  23. Case 7:
  24. Animation.type = @ "Camerairishollowclose";//106 lens off
  25. Break
  26. Default
  27. Break
  28. }



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.