Quantcast
Viewing all articles
Browse latest Browse all 8068

Checking Listitem's X/Y Coordinate While Using the Touchmove Event for The Listview

Regardless of the device's screen density and resolution, is there a neat trick where can I touch and drag the listview, looking for each listitem's coordinate? For example, I used the scrollToItem(sectionIndex, itemIndex) to hold in place so that I can touch, drag, and hover listitems around the listview. Now, I want to know or how to check for X and Y coordinates for each listitem for every time I hover it. Any ideas how?

Here's an example: I touchhold or using the longpress event, I check via console.log(message) to check the list item's index. Now, as I touch and drag or using touchmove event, I keep moving my finger until my finger reaches to the next list item. While highlighted, I am expecting to see or check to identify hoping for revealing next listitem's index number. Let's say, I started from index 0 via the first list item and when I drag it to the next listitem and the name of the next list item I'm holding on is index 1.

In order to do that to perform this successful program, I have to identify and get the listitem's X and Y coordinates to check the content of the listitem so that I could calculate it according to that area regardless of its size.


Viewing all articles
Browse latest Browse all 8068

Trending Articles