#在蓝懿学习iOS的日子 # Seventh Day of Practice

Source: Internet
Author: User

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

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.