對於動畫我必須聽ViewPropertyAnimator的每一步。我使用AnimatorUpdateListener
結合setUpdateListener
。
源:http://developer.android.com/reference/android/view/ViewPropertyAnimator.html在api級別使用setUpdateListener低於19
實施例如何使用它:
image.animate().translationY(transY).setDuration(duration).setUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
// do my things
}
});
查閱即時從A移動一個目的是B和必須detect
一些事情而移動。現在setUpdateListener對此非常有幫助,而且這個代碼一切正常。但它需要api級別19.我真的想爲這個項目使用api level 14。 setUpdateListener
有沒有其他選擇?
ViewPropertyAnimator.setUpdateListener
Call requires api level 19 (current min is 14)
你可以使用一個valueanimator?它看起來像它的addUpdateListener只需要api 11. – Whitney 2014-12-03 15:58:46