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