image is playing an animation and the image is clickable

后端 未结 1 1691
清酒与你
清酒与你 2020-12-18 15:53

I\'ve made a simple animation for an image and I set the event OnClick on the image to make a toast. The problem is that I made the image started doing the animation on the

相关标签:
1条回答
  • 2020-12-18 16:09

    Have a read over the documentation for the Android animation system (docs link), specifically the difference between View Animation and Property Animation. Here is a quote from the View Animation doc:

    Note: Regardless of how your animation may move or resize, the bounds of the View that holds your animation will not automatically adjust to accommodate it.

    Essentially, when using View Animation, the view itself is never translated, only the location at which it is drawn. The object remains at its original coordinates, which is why you have to tap the old location to get an event. This is a known limitation of View Animation and is one of the reasons Property Animation was introduced in Android 3.0+

    0 讨论(0)
提交回复
热议问题