When a CustomListView in B4i has not enough list items, to fill the screen, it shows the items on the buttom, In that moment, when .ScrollToItem is called.
B4X:
clv.ScrollToItem(iIndex) 'why items to the buttom?
Thanks! In my app it was not a good behavior. I helped me now with this code:
B4X:
Sub JumpToListItem(clv As CustomListView, index As Int, animated As Boolean)
If clv.Size > index Then
#if B4i 'avoid jumping items to the buttom (behavior of the underlying UIScrollView control)
If clv.FirstVisibleIndex = 0 And clv.LastVisibleIndex = clv.Size - 1 Then Return 'all items are visible anyhow
#End If
If animated Then
clv.ScrollToItem(index)
Else
clv.JumpToItem(index)
End If
End If
End Sub