iOS 18th day (1, core animation layer, rotate, scale, pan, border, trim, fillet)

Source: Internet
Author: User

Animation effects

- (void) Touchesbegan: (Nsset *) touches withevent: (Uievent *)Event{[UIView animatewithduration:1animations:^{                //Rotate//_imageview.layer.transform = Catransform3dmakerotation (M_PI, 1, 1, 0); //panning//_imageview.layer.transform = catransform3dmaketranslation (200, 200, 0); //Zoom//_imageview.layer.transform = Catransform3dmakescale (1, 0.5, 1); //using KVC to change the deformation//nsvalue *rotation = [Nsvalue valuewithcatransform3d:catransform3dmakerotation (M_PI, 1, 1, 0)]; //[_imageview.layer setvalue:rotation forkeypath:@ "transform"]; //[_imageview.layer setValue: @M_PI forkeypath:@ "Transform.rotation"]; //[_imageview.layer setvalue:@0.5 forkeypath:@ "Transform.scale"]; //Pan x Axis[_imageview.layer setvalue:@ $Forkeypath:@"transform.translation.x"]; }];}

Border, rounded, cropped

- (void) imagelayer{//Circular cropping_imageview.layer.cornerradius = -; //cut out all of the layer borders_imageview.layer.maskstobounds =YES; _imageview.layer.bordercolor=[Uicolor Whitecolor].    Cgcolor; _imageview.layer.borderwidth=2;}- (void) viewlayer{//Set Shadow Transparency_redview.layer.shadowopacity =1; //Set Shadow color_redview.layer.shadowcolor =[Uicolor Yellowcolor].        Cgcolor; //set the radius of a shadow fillet_redview.layer.shadowradius =Ten; //set the fillet radius_redview.layer.cornerradius = -; //Set Border radius_redview.layer.bordercolor =[Uicolor Whitecolor].        Cgcolor; //Set Border radius_redview.layer.borderwidth =2;}

iOS 18th day (1, core animation layer, rotate, scale, pan, border, trim, fillet)

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.