Tuesday, 15 May 2012

drag and drop - find center position in imageview android -


I am working on drag and drop mechanism This is a horrible blog that helps me with implementation

That's why I have dragent, but I want touch position in the middle of the image so that it looks good. How to get the coordinates for the middle of the scene so that I can pass those coordinates as the starting position?

How to find a clue?

This is simple math.

  Image visual view = ..... ET center X = (view.getLeft () + view. GetRight ()) / 2; Int o Center Y = (see. Gadgettop) + visual.gatem ()) / 2;   

This will return the center coordinates of the scene. Due to round errors it can be closed due to 1.

No comments:

Post a Comment