What is the difference between ViewPropertyAnimator's translateYBy() vs yBy() methods?

后端 未结 4 1410
甜味超标
甜味超标 2021-02-03 19:58

ViewPropertyAnimators (http://developer.android.com/reference/android/view/ViewPropertyAnimator.html) have two types of methods to move Views around:

translateX() vs x(

4条回答
  •  隐瞒了意图╮
    2021-02-03 20:46

    translationX and translationY: These properties control where the View is located as a delta from its left and top coordinates which are set by its layout container.

    x and y: These are simple utility properties to describe the final location of the View in its container, as a sum of the left and top values and translationX and translationY values.

    Animate views docs

提交回复
热议问题