Radek Szpila
Radek Szpila

Reputation: 19

How to set OnClickListener to rotated ImageView?

I need to set an OnClick listener on a rotated rectangle ImageView. I've got problem when setting itafter rotation (angle 45). When i rotated my ImageView, region of the OnClickListener answers in the same place as before rotate :(

Any ideas?

Upvotes: 1

Views: 595

Answers (1)

Jens
Jens

Reputation: 17077

Tween Animations doesn't really "move" the View, it just alters where it is drawn, i.e. you're going to have to add an AnimationListener and resize (in your case, changing the margins should work)/move the object after the animation has completed for the "physical" location to update.

It's a lot better in Honeycomb / Ice cream sandwich with property animations.

Upvotes: 3

Related Questions