iOS development UI Chapter----UI Basics Transform

Source: Internet
Author: User

1 //panning2-(Ibaction) Trasnlate: (ID) Sender {3     //One -time move 10 of the distance4 //_button.transform = cgaffinetransformmaketranslation (ten, 0);5     6     //If you want to keep moving, you need to get the transform of the current view7     //1. Get the Transform property of the current button8Cgaffinetransform transform =_button.transform;9     Ten     //2. Modification on the basis of transform One_button.transform = Cgaffinetransformtranslate (transform,Ten,0); A } -  - //Zoom the-(Ibaction) Scal: (ID) Sender { -     //Performing scaling - //_button.transform = Cgaffinetransformmakescale (0.5, 0.5); -      +     //Continuous Scale Execution -     //1. Get the transform of the current button +Cgaffinetransform transform =_button.transform; A      at     //2. Make changes in transform -_button.transform = Cgaffinetransformscale (transform,0.5,0.5); - } -  - //Rotate --(ibaction) Rotate: (ID) Sender { in      - //_button.transform = cgaffinetransformmakerotation (m_pi_4); to      +    -      the[UIView animatewithduration:1animations:^{ *         //1. Get the transform of the current button $Cgaffinetransform transform =Self.button.transform;Panax Notoginseng          -         //2. Make changes in transform theSelf.button.transform =cgaffinetransformrotate (transform, m_pi_4); +          ASelf.button.transform = Cgaffinetransformtranslate (transform, -,0); the          +Self.button.transform = Cgaffinetransformscale (transform,1.5,1.5); -     }]; $ } $  --(ibaction) Reset: (ID) Sender { -     //Restore Original State the_button.transform =cgaffinetransformidentity; -}
View Code

iOS development UI Chapter----UI Basics Transform

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.