Animation-Layer

来源:互联网 发布:51电子单片机原理图 编辑:程序博客网 时间:2024/06/05 23:13

Animatable properties

Layer animations have some properties for developers to control.

Position & Size & Transform

position

modify this to animate the position of the layer within it’s parent layer.

bounds

modify this to animate the bounding frame of the layer.

transform

modify this to move,scale,and rotate the layer.You can even animate layers in 3D space.

Border

a layer’s borderColor,borderWidth,cornerRadius can be modified to change a layer’s appearance.

Shadow

shadowOffset : contro a shadow appear closer to or further away from a layer
shadowOpacity : modify this to make the shadow fade in or out.
shadowPath : modify this to change the shape of the layer’s shadow.
shadowRadius : modify this to control the blur(模糊度) of the shadow; this is especially useful when simulating movement of the view towards(朝向) or away from the surface(外观) where the shadow is cast(投射). 这个属性在这个情况下很有用:控制一个 view 靠近或离远时,设置 view 的 shadow 模糊度从而使动画更惟妙惟肖。

Contents

contents : modify this to assign(指定) a raw(原始的) TIFF or PNG data as the layers contents
mask : modify this to establish(放置) the shape or image you’ll use to mask the visible contents of the layer. 将一个形状图层或者图片放置到 layer 上形成遮盖
opacity(透明度) : animate the transparency of the layer contents

this is only a partial list of properties you can niamate;

Animations vc real content

when you start animating a textfield ,you’re not actually seeing the field itself animated; instead ,you’re seeing a cached version of it known as the presentation layer. The presentation layer is moved from the screen once the animation completes,and the original layer show itself again. So , you can’t tap the animated field , enter any text , because it’s not the truly field.

0 0