iOS animation development of the three--uiview transition switch

Source: Internet
Author: User

iOS animation development of the three--uiview transition switch

in the first two blogs, we introduced two ways to use UIView animations, respectively, with block:http://my.oschina.net/u/2340880/blog/484457 , Traditional way of configuring properties: http://my.oschina.net/u/2340880/blog/484538. By UIView the class method of animation, we can make it very convenient to change some properties of the view while having animation effect. This blog mainly discusses the animation operation of view switching.

Two methods:

+ (void ) Transitionwithview: (uiview *) View Duration: ( nstimeinterval ) Duration options: () Options animations: (void (^) (void ) Animations Completion: (void (^) (bool finished)) completion;

in this way, we can redraw the view, any changes to its sub-view or its own changes will trigger the effect of the transition animation, the system provides the transition effect in the first blog has been described.

This method is often used to flip-page effects like novel software.


+ (void ) Transitionfromview: (uiview *) Fromview Toview: (uiview *) Toview Duration: (nstimeinterval ) Duration options: (uiviewanimationoptions ) Options Completion: (void (^) (bool finished)) completion;

This method acts on the parent view of Fromview, which toggles two views, and by doing this, the FormView is removed from its parent view, and the Toview is glued to its parent view to show an animated effect.


By using these two methods, you will find that some effects will be very abrupt, such as want to change the color of the view, it will be the transition animation after the completion of the color changes, to improve this effect, we need to set the options parameter contains: Uiviewanimationoptionallowanimatedcontent this enumeration.



iOS animation development of the three--uiview transition switch

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.