Can any one tell how to get x and y coordinates of user tap/touch relative to window - android titanium mobile??
I need to add a popup view close to tableviewrow when the user select a row. How to determine the x,y (top/left) positions?
Can any one tell how to get x and y coordinates of user tap/touch relative to window - android titanium mobile??
I need to add a popup view close to tableviewrow when the user select a row. How to determine the x,y (top/left) positions?
you can use
where row is an object of Titanium.UI.TableViewRow. For other objects (like window/view), you can use same eventlistener.
But remember one thing: it gives the co-ordinates with respect to the corresponding row. i.e. you may get same co-ordinates for all the rows.
Therefor, if you want to popup something on that co-ordinate, you should
addEventListener
to the main window.On click event of any view or object you get x and y coordinate see this link for more reference:
Titanium.UI.Window
This might help you as the window or object touch events can help you find the exact points the user have touched on screen. thanks