Description
In the ListView having approx 60 rows, "scrollToItem" method is not repositioning the selected index item (row) to the top of the view.
If, the row is part of the currently visible rows. so for example if i want to programatically move row index 5, up, to the position of row 0, via:
$.listview.scrollToItem(0,5);
the ListView row's do not move at all. however i would expect row 5, to reposition itself to become effectively row "0" (ie. top of the ListView) but this does not occur.
Test Case
index.xml
<Alloy>
<Window fullscreen="true">
<ListView id="listview">
<HeaderView>
<View backgroundColor="#DDD" height="Ti.UI.SIZE">
<Button id="button" onClick="doClick" title="CLICK"
top="10" width="100" height="50" />
</View>>
</HeaderView>
<ListSection>
<ListItem title="Papaya" searchableText="Papaya"/>
<ListItem title="Peach" searchableText="Peach"/>
<ListItem title="Pear" searchableText="Pear"/>
<!-- ADD MORE ROWS -->
</ListSection>
</ListView>
</Window>
</Alloy>
index.js
function doClick(e) {
Ti.API.info('clicked');
$.listview.scrollToItem(0,5);
}
$.index.open();
No comments