Catransition transfer animation-iOS development

Source: Internet
Author: User
Statement

You are welcome to repost this article, but please respect the author's Labor achievements. repost this article and keep the statement in this box. Thank you.
ArticleSource: http://blog.csdn.net/iukey

First recommend a post: http://www.cocoachina.com/bbs/read.php? Tid-10972.html

An animation object can be attached to an existing view.

Import the quartz qore framework

# Import <quatzcore/caanimation. h> catransition * mytransition = [catransition animation]; // create catransitionmytransition. duration = 0.3; // Duration: 0.3 seconds mytransition. timingfunction = uiviewanimationcurveeaseinout; // timing function, smooth from start to end mytransition. type = kcatransionpush; // animation type mytransition. subtype = kcatransitionfromleft; // subtype // to make an animation take effect, add the animation to the layer to be attached to the animation view. For example, to transfer an animation between two view controllers, add the animation to the window layer: [[self. view. superview layer] addanimation: mytransition forkey: Nil]; // if you want to transfer the subview in the Controller to another subview, add the animation to the layer of the View Controller. Another option is to use the internal view of the View Controller as an alternative, and use your child view as the child layer of the main view: [self. view. layer addanimation: mytransition forkey: Nil]; [self. view addsubview: newview]; [oldview removefromsuperview]; // if you are using a navigation controller, add the animation to the view layer of the navigation controller. [Navigationcontroller. View. layer addanimation: mytransition forkey: Nil];

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.