您的位置:首页 > 移动开发 > IOS开发

Animation-Layer

2016-07-28 17:07 435 查看

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  iOS animation layer