Animatable Properties(可以执行动画的属性)

Only numeric layer properties can be animated:
译:只有数值类型的属性才可以执行动画:

  • x, y, z
  • minX, midX, maxX
  • minY, midY, maxY
  • width, height
  • opacity
  • rotation, rotationX, rotationY, rotationZ
  • scale scaleX, scaleY, scaleZ
  • originX, originY, perspective
  • scrollX, scrollY
  • borderRadius, borderWidth
  • shadowX, shadowY, shadowBlur, shadowSpread
  • blur, brightness, saturate
  • hueRotate, contrast, invert, grayscale, sepia
Multiple Properties(多属性动画)

You can start multiple animations targeting the same layer, as long as they don't target the same properties. If you start two animations both targeting x for the same layer, the second one will fail.
译:你可以同时执行一个图层的不同属性动画,但是不能对同一个属性同时执行动画。如果你给一个图层的一个属性写了两个动画,那么后面的那个动画就不会执行。

Performance(性能)

Most properties benefit from GPU accelerated drawing. You can animate many of them smoothly. But some properties need to involve the CPU to animate, and are therefore more expensive to render:
译:大部分属性的动画只需要GPU渲染,他们就会表现地很平滑。但是也有一些属性动画需要CPU参与渲染,这些就比较耗性能:

  • width
  • height
  • scrollX
  • scrollY
  • borderRadius
  • borderWidth

results matching ""

    No results matching ""