Programmatically Translate View Pre-Honeycomb

后端 未结 7 1627
借酒劲吻你
借酒劲吻你 2021-01-30 00:09

How can I programmatically translate an arbitrary view without using an animation (android.view.animation.*)?

API 11 introduced setTranslationX

7条回答
  •  走了就别回头了
    2021-01-30 00:42

    I was having the same problem. I was able to achieve the translation by manipulating the layoutparams, specifically the margins, of the views I wanted to translate. You can use negative values for the margins btw.

提交回复
热议问题