ListView distance from top of the list
<p>I have a ListView, and I want to make a background that scrolls with the list.</p>

<p>I saw the code for <a href="http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/view/ShelvesView.java" rel="nofollow">Shelves</a>, which works because all of the items in the GridView are the same height, which is a guarantee that I can't make. I figure that I can use a similar technique (that is, override dispatchDraw), but I need to know the distance from the top of the ListView for each item - how can I pre-calculate this? The ListView is mostly static and fairly small, so it's okay if I have to recalculate when adding a new item to the list.</p>

<p>So my question is this: Given a ListView and an List adapter, how can I calculate the distance of each item from the top of the list? That is, item 0 would be 0 pixels from the top, item 20 might be 4032 pixels from the top. Alternately, is there a better way to do what I want to do?</p>
