It's convenient to write your own animation functions.

Source: Internet
Author: User

 

-(Void) UIViewAnimation :( UIView *) view

Frame :( CGRect) frame

Type :( int) type

Alpha :( float) alpha

Duration :( float) duration

{

[UIView beginAnimations: nil context: nil];

[UIView setAnimationDuration: duration];

[UIView setAnimationCurve: type];

[UIView setAnimationDelegate: self];

View. alpha = alpha;

View. frame = frame;

[UIView commitAnimations];

}

 

Call Method


[Self UIViewAnimation: downView frame: CGRectMake (0, height, 320, 58) type: UIViewAnimationCurveEaseOut alpha: 1 duration: 0.3];

 

DownView is the animation view.


CGRectMake (0, height, 320, 58) Location Conversion


UIViewAnimationCurveEaseOut animation effect

 


There are also:

UIViewAnimationCurveEaseInOut, // slow at beginning and end

UIViewAnimationCurveEaseIn, // slow at beginning

UIViewAnimationCurveEaseOut, // slow at end

UIViewAnimationCurveLinear

 

1. Transparency change


0.3 animation time


 

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.