| Properties |
Description |
whether implicit animations are supported |
| Anchorpoint |
A point position coincident with the center point, called an "anchor point," where the anchor is described by default at the center point of the image (0.5,0.5) relative to the X, Y position ratio |
Is |
| BackgroundColor |
Layer background color |
Is |
| BorderColor |
Border color |
Is |
| BorderWidth |
Border width |
Is |
| Bounds |
Layer Size |
Is |
| Contents |
Layers display content, such as the ability to display a picture as a layer content |
Is |
| Contentsrect |
The size and position of the layer display content |
Is |
| Cornerradius |
Fillet radius |
Is |
| doublesided |
If the back of the layer is displayed, the default is Yes |
Whether |
| Frame |
The layer size and position does not support implicit animation, so frame is rarely used in calayer, usually using bounds and position instead |
Whether |
| Hidden |
Whether to hide |
Is |
| Mask |
Layer Masks |
Is |
| Masktobounds |
Whether sublayers cut layer boundaries, default to No |
Is |
| Opacity |
Transparency, similar to the alpha of UIView |
Is |
| Position |
The location of the center point of the layer, similar to the UIView |
Is |
| Shadowcolor |
Shadow color |
Is |
| Shadowoffset |
Shadow Offset |
Is |
| Shadowopacity |
Shadow transparency, note the default is 0, this property must be set if the shadow is set |
Is |
| Shadowpath |
Shape of the Shadow |
Is |
| Shadowradius |
Shadow Blur Radius |
Is |
| Sublayers |
Sub-layer |
Is |
| Sublayertransform |
Child layer Deformation |
Is |
| Transform |
Layer deformation |
Is |
- Calayer in iOS is designed primarily for content presentation and animation operations, and Calayer itself is not included in Uikit, and it cannot respond to events.
- Calayer Many properties can be animated when modified, which is called an implicit animation property. The essence of implicit property animation is that the change of these attributes implies the Cabasicanimation animation implementation by default; The frame property is rarely used in Calayer because the frame itself does not support animation effects, usually using bounds and position instead. transparency in Calayer uses opacity instead of alpha, and the center point uses a position representation instead of center.
- The modification of a property is not animated for UIView's root layer, because in many cases the root layer acts more as a container
- UIView root layer creation work is completely done by iOS and cannot be recreated, but you can add sublayers or remove sublayers to the root layer
Properties of the Calayer