1. Results show
2. Realization of Ideas
1. Using a duplicate layer, make a uiimageview display picture, and then copy the Uiimageview.
2. Note: 复制图层只能复制子层,但是UIImageView只有一个主层,并没有子层,因此不能直接复制UIImageView .
3. Correct practice: The Uiimageview should be added to a uiview, and then copy the UIView layer, you can copy the Uiimageview.
Attention:默认A控件是B控件的子控件,那么A控件的层就是B控件的层的子层。
4. But there is a problem, the default UIView layer is not the replication layer, we want to change the UIView layer into a copy layer, rewrite the +layerclass method.
+ (Class)layerClass{ returnclass];}
5. Reflection effect: is to copy the picture rotated 180 degrees, and then pan down, preferably first offset in, in the rotation.
Careplicatorlayer *layer = (Careplicatorlayer *) self. V. Layer;Layer. InstanceCount=2;FirstYAxis offset Catransform3d transform = catransform3dmaketranslation (0, self. V. Bounds. Size. Height,0);In rotation transform = catransform3drotate (transform, M_PI,1,0,0);Set the layer of deformation for the replication layers. Instancetransform= Transform;Sets the color channel offset, equal to a point offset, which is the shadow effect layer. Instanceredoffset= -0.1;Layer. Instancegreenoffset= -0.1;Layer. Instanceblueoffset= -0.1;Layer. Instancealphaoffset= -0.1;
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Reflection of iOS animations