CALayer 一个管理基础图容并允许您执行动画内容的对象。
Layers 通常被用于去提供views的后备存储. A layer’s 的主要工作是管理您提供的视觉内容,但layer’s本身视觉属性可以设置,如背景颜色,边境,和阴影。除了管理视觉内容,该层还维护其内容的几何信息(比如它的位置、大小和变换),用于在屏幕上显示这些内容。修改layer的属性决定着你怎么样在layer几何内容上启动动画。对象封装一层一层的持续时间和节奏及其动画采用CAMediaTiming协议,它定义了层的计时信息。
如果这个layer是由View所创建的,那么这个 View将会自动成为 layer的委托对象,你不应该改变这种关系。因为层自己创建了自己,层你可以指定一个委托对象,并使用该对象提供 layer的动态内容 和执行其他任务。 layer 也有一个布局管理器对象(分配给layoutManager属性)来分别管理子视图的布局。
Creates and returns an instance of the layer object.
Returns an initialized CALayer
object.
Override to copy or initialize custom fields of the specified layer.
Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen.
Returns the model layer object associated with the receiver, if any.
The layer’s delegate object.
An object that provides the contents of the layer. Animatable.
The rectangle, in the unit coordinate space, that defines the portion of the layer’s contents that should be used. Animatable.
The rectangle that defines how the layer contents are scaled if the layer’s contents are resized. Animatable.
Reloads the content of this layer.
Draws the layer’s content using the specified graphics context.
A constant that specifies how the layer's contents are positioned or scaled within its bounds.
The opacity of the receiver. Animatable.
A Boolean indicating whether the layer is displayed. Animatable.
A Boolean indicating whether sublayers are clipped to the layer’s bounds. Animatable.
An optional layer whose alpha channel is used to mask the layer’s content.
A Boolean indicating whether the layer displays its content when facing away from the viewer. Animatable.
The radius to use when drawing rounded corners for the layer’s background. Animatable.
The width of the layer’s border. Animatable.
The color of the layer’s border. Animatable.
The background color of the receiver. Animatable.
The opacity of the layer’s shadow. Animatable.
The blur radius (in points) used to render the layer’s shadow. Animatable.
The offset (in points) of the layer’s shadow. Animatable.
The color of the layer’s shadow. Animatable.
The shape of the layer’s shadow. Animatable.
An optional dictionary used to store property values that aren't explicitly defined by the layer.
A Boolean indicating whether the layer is allowed to perform edge antialiasing.
A Boolean indicating whether the layer is allowed to composite itself as a group separate from its parent.
An array of Core Image filters to apply to the contents of the layer and its sublayers. Animatable.
A CoreImage filter used to composite the layer and the content behind it. Animatable.
An array of Core Image filters to apply to the content immediately behind the layer. Animatable.
The filter used when reducing the size of the content.
The bias factor used by the minification filter to determine the levels of detail.
The filter used when increasing the size of the content.
A Boolean value indicating whether the layer contains completely opaque content.
A bitmask defining how the edges of the receiver are rasterized.
Returns a Boolean indicating whether the layer content is implicitly flipped when rendered.
A Boolean that indicates whether the geometry of the layer and its sublayers is flipped vertically.
A Boolean indicating whether drawing commands are deferred and processed asynchronously in a background thread.
A Boolean that indicates whether the layer is rendered as a bitmap before compositing. Animatable
The scale at which to rasterize content, relative to the coordinate space of the layer. Animatable
A hint for the desired storage format of the layer contents.
Renders the layer and its sublayers into the specified context.
The layer’s frame rectangle.
The layer’s bounds rectangle. Animatable.
The layer’s position in its superlayer’s coordinate space. Animatable.
The layer’s position on the z axis. Animatable.
The anchor point for the layer’s position along the z axis. Animatable.
Defines the anchor point of the layer's bounds rectangle. Animatable.
The scale factor applied to the layer.
The transform applied to the layer’s contents. Animatable.
Specifies the transform to apply to sublayers when rendering. Animatable.
Returns an affine version of the layer’s transform.
Sets the layer’s transform to the specified affine transform.
An array containing the layer’s sublayers.
The superlayer of the layer.
Appends the layer to the layer’s list of sublayers.
Detaches the layer from its parent layer.
Inserts the specified layer into the receiver’s list of sublayers at the specified index.
Inserts the specified sublayer below a different sublayer that already belongs to the receiver.
Inserts the specified sublayer above a different sublayer that already belongs to the receiver.
Replaces the specified sublayer with a different layer object.
Marks the layer’s contents as needing to be updated.
Marks the region within the specified rectangle as needing to be updated.
A Boolean indicating whether the layer contents must be updated when its bounds rectangle changes.
Initiates the update process for a layer if it is currently marked as needing an update.
Returns a Boolean indicating whether the layer has been marked as needing an update.
Returns a Boolean indicating whether changes to the specified key require the layer to be redisplayed.
Add the specified animation object to the layer’s render tree.
Returns the animation object with the specified identifier.
Remove all animations attached to the layer.
Remove the animation object with the specified key.
Returns an array of strings that identify the animations currently attached to the layer.
The object responsible for laying out the layer’s sublayers.
Invalidates the layer’s layout and marks it as needing an update.
Tells the layer to update its layout.
Recalculate the receiver’s layout, if required.
Returns a Boolean indicating whether the layer has been marked as needing a layout update.
A bitmask defining how the layer is resized when the bounds of its superlayer changes.
- resizeWithOldSuperlayerSize:
Informs the receiver that the size of its superlayer changed.
Informs the receiver’s sublayers that the receiver’s size has changed.
Returns the preferred size of the layer in the coordinate space of its superlayer.
The constraints used to position current layer’s sublayers.
Adds the specified constraint to the layer.
Returns the action object assigned to the specified key.
A dictionary containing layer actions.
Returns the default action for the current class.
Converts the point from the specified layer’s coordinate system to the receiver’s coordinate system.
Converts the point from the receiver’s coordinate system to the specified layer’s coordinate system.
Converts the rectangle from the specified layer’s coordinate system to the receiver’s coordinate system.
Converts the rectangle from the receiver’s coordinate system to the specified layer’s coordinate system.
Converts the time interval from the specified layer’s time space to the receiver’s time space.
Converts the time interval from the receiver’s time space to the specified layer’s time space
Returns the farthest descendant of the receiver in the layer hierarchy (including itself) that contains the specified point.
Returns whether the receiver contains a specified point.
The visible region of the layer in its own coordinate space.
Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified point lies at the origin of the scroll layer.
Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified rectangle becomes visible.
The name of the receiver.
Returns a Boolean indicating whether the value of the specified key should be archived.
Specifies the default value associated with the specified key.
These constants are used by the autoresizingMask
property.
These constants are the predefined action identifiers used by actionForKey:
, addAnimation:forKey:
, defaultActionForKey:
, removeAnimationForKey:
, Accessing the Layer’s Filters, and the CAAction
protocol method runActionForKey:object:arguments:
.
This mask is used by the edgeAntialiasingMask
property.
The contents gravity constants specify the position of the content object when the layer bounds is larger than the bounds of the content object. The are used by the contentsGravity
property.
Defines the identity transform matrix used by Core Animation.
These constants specify the scaling filters used by magnificationFilter
and minificationFilter
.
Defines the standard transform matrix used throughout Core Animation.