Android Property Animation

对着背影说爱祢 提交于 2019-12-01 03:04:48

The propertyName parameter can be any property defined by the animation target's class. For instance, if the object you're animating offer a getFoo() and a setFoo() method, then there is a "foo" property you can animate.

A very simple example is View's getAlpha() and setAlpha() methods. They defined together the "alpha" property that you can animate to create fading effects

This also means you can create your own properties in your custom views. All you need to do is create two public methods: a getter and a setter.

You can look at this page for more information: http://developer.android.com/guide/topics/graphics/prop-animation.html#object-animator

for honeycomb and above the available ones (according to this website) are:

  • translationX
  • translationY
  • rotation
  • rotationX
  • rotationY
  • scaleX
  • scaleY
  • pivotX
  • pivotY
  • x
  • y
  • alpha

as mentioned, you can also create your own properties, using get&set . i wonder if the new android versions have more properties built in.

you can also test them out in the API demos , in nineOldAndroids library , and on one of samsung samples.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!