Lan Yi Education September 27 record

Source: Internet
Author: User

will be VIew move to animate effect There is no intermediate displacement of this animation effect

You can add animations to the View Properties Center , Frame,alpha,transform , BackgroundColor

// continue to do the disappearing animation

[UIView animatewithduration:1 animations: ^{

iv. Alpha = 0;

} Completion: ^ (BOOL finished) {

// finish animation after execution can continue to add

[IV Removefromsuperview];

}];

-(void) Viewdidload {

[Super viewdidload];

//Do anyadditional setup after loading the view, typically from a nib.

[nstimer scheduledtimerwithtimeinterval:0.1 target: self Selector :@selector(addsnow) userInfo:nil repeats:YES];

}

-(void) addsnow{

int size = arc4random()%+ten;

uiimageview *iv = [[uiimageviewalloc]initwithframe:cgrectmake( Arc4random()% (-size),-size, size, size)];

iv. image = [UIImageimagenamed:@ "Snow"];

[Self. View Addsubview: IV];

int time = arc4random()%4+1;

// add move animation

[UIView animatewithduration: Time animations: ^{

// Move the end position

iv. Center = cgpointmake(Iv. Center. x, 568);

// Graphics change End shape

iv. Transform = cgaffinetransformrotate(Iv. Transform, (arc4random()%)/180.0*m_pi);

} Completion: ^ (BOOLfinished) {

// continue to make snowflakes disappear animation

[UIView animatewithduration:1 animations: ^{

iv. Alpha = 0;

} Completion: ^ (BOOL finished) {

[IV Removefromsuperview];

}];

}];

}


Lan Yi Education September 27 record

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.