Ios development: Implementation of simple animation on the second day, and ios development on the second day
First of all, you should have some knowledge about views. I will not introduce them here,
First, let's talk about a head-and-tail animation that is basically no longer used.
First set a view UIView * testView = [UIView alloc] init];
Determine the position self. testView. frame = CGRectMake (0, 0, 50, 50 );
Start Animation
[UIView beginAnimations: nil context: nil]
Set animation duration
[UIView setAnimationDuration: 2.0]
Animated Attribute Value
Self. testView. frame = rect;
Self. testView. backgroundColor = [UIColor blueColor];
Submit an animation
[UIView commitAnimations];
Block animation is a popular animation method. There are many details to explore, many methods, and attributes to explore.
[UIView animateWithDuration: duration delay: latency usingSpringWithDamping: flexible initialSpringVelocity: animation Running Speed options: animation running mode option animations: ^ {
Code executed during animation running
} Completion: ^ (BOOL finished ){
Code executed after the animation is completed
}];
Today, due to the time relationship, we will share such a simple animation here.