IOS--Rotate animation

Source: Internet
Author: User

   /** * Use the image layer to add to the carousel **/    //The anchor point of the pointer is relative to itself, the upper-left corner is (0,0), and the lower-right corner is (Self.zhen.layer.anchorPoint = Cgpointmake (0.5,1); NSLog (@"%@", Nsstringfromcgpoint (Self.zhen.layer.anchorPoint)); //position position relative to the parent viewSelf.zhen.layer.position = Cgpointmake (self.pan.bounds.size.width- +, self.pan.bounds.size.height- +); //RotateSelf.zhen.layer.transform = Catransform3dmakerotation (-m_pi_2,0,0,1); //add a layer of the pointer to the layer on the Carousel[Self.pan.layer AddSublayer:self.zhen.layer];
   /** * Draw your own Calayer add to the carousel **/Calayer*layer =[Calayer layer]; //The anchor point of the pointer is relative to itself, the upper-left corner is (0,0), and the lower-right corner is (Layer.anchorpoint = Cgpointmake (0.5,1); //position position relative to the parent viewLayer.position = Cgpointmake (self.pan.bounds.size.width- +, self.pan.bounds.size.height- +); //set the background color of a layerLayer.backgroundcolor =[Uicolor Redcolor].    Cgcolor; //set the bounce of a layerLayer.bounds = CGRectMake (0,0,2, self.pan.bounds.size.height- -); //RotateLayer.transform = Catransform3dmakerotation (-m_pi_2+ +/50.0*m_pi_2,0,0,1); //add to turn oh press on the layer[Self.pan.layer Addsublayer:layer];

Run as:

IOS--Rotate animation

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.