iOS control Code Transform learning notes

Source: Internet
Author: User

1. Picture settings (pan, zoom, rotate)

Create a Transform property

//when the button is clicked, you can only perform an upward rotation//Pi m_pi_4 45 degree rotation 1. Cgaffinetransform transforms=cgaffinetransformmakerotation (m_pi_4);//zoom can be performed multiple times when the button is clicked//Self.image.transfrom Gets the original location image is the property name of the picture definition 2. Cgaffinetransform TRANSFORMS =cgaffinetransformrotate (Self.image.transform, m_pi_4); //when the button is clicked, you can pan up multiple times//Self.view.transfrom Get the original location//Y-Axis 0 remains motionless//X-axis-50 pan up 3. Cgaffinetransform transforms = cgaffinetransformmaketranslate (0, - -); //when the button is clicked, the pan can be executed multiple times 4. Cgaffinetransform transforms = cgaffinetransformtranslate (Self.image.transform,0, - -); //when the button is clicked, only one zoom up is performed//zoom in 1.5 times times such as: 0.5 is reduced  5. Cgaffinetransform transforms= Cgaffinetransformmakescale (1.5,1.5);//zoom can be performed multiple times when the button is clicked  6. Cgaffinetransform transforms = Cgaffinetransformscale (Self.image.transform,0.5,0.5); //assign a value to a button   7. Self.image.transform =transforms; //Restore originally  8. Self.image.transform =cgaffinetransformidentity; //Animation Execution Code 9. [UIView animatewithduration:3animations:^{self.image.transform= Cgaffinetransformtranslate (Self.image.transform,0, - -); Self.image.transform= Cgaffinetransformscale (Self.image.transform,0.5,0.5); Slef.image.transform=cgaffinetransformrotate (Self.image.transform, m_pi_4); }];

iOS control Code transform learning notes

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.