Review the contents of these two days of study
Animation/frame bounds Alpha background color Center transform (conversion)
uiimageview* IV =[[uiimageview alloc]initwithframe:cgrectmake (100, 100, 100, 100)];
Iv.image = [UIImage imagenamed:@ "8.jpg"];
[Self.view Addsubview:iv];
Spin gradient animatewithduration (animation duration)
[UIView Animatewithduration:3 animations:^{
Iv.center = Cgpointmake (300, 300);
Iv.alpha =. 5;
Iv.transform = Cgaffinetransformscale (Iv.transform,. 5,. 5);
Rotation
Iv.transform =cgaffinetransformrotate (Iv.transform, 90.0*m_pi/180);
// }];
No.2 in situ to the left completion complete
[UIView Animatewithduration:3 animations:^{
Iv.transform = Cgaffinetransformrotate (Iv.transform, 90.0*m_pi/180);
} completion:^ (BOOL finished) {
[IV Removefromsuperview];
// }];
No.3 delay (lag time)
[UIView animatewithduration:3 delay:3 Options:uiviewanimationoptioncurveeasein animations:^{
Iv.center = Cgpointmake (300, 300);
} completion:^ (BOOL finished) {
[IV Removefromsuperview];
}];} Rotating, left-handed
number++;
Cgaffinetransform rotate = cgaffinetransformmakerotation (number/180.0 * m_pi);
[Viewdemo Settransform:rotate];
}
If you use this method to click the button continuously, you can display the movement effect at 1.1 points.
You can use the code to achieve the effect each time you rotate 90 degrees.
-(void) Testviewdemo
{
Rotating, right-handed
Number = number+90.0;
Cgaffinetransform rotate = cgaffinetransformmakerotation (number/180.0 * m_pi);
[Viewdemo Settransform:rotate];
}
UIView for a left-handed effect
Rotating, left-handed
Number = number-90.0;
Cgaffinetransform rotate = cgaffinetransformmakerotation (number/180.0 * m_pi);
[Viewdemo Settransform:rotate];
#在蓝懿学习iOS的日子 # Seventh Day of Practice