/** * 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