Hi everyone
i am trying to add many items to index 0 of a XUI CustomListView and immediately after each item added i want to scroll to the previous offset, taking into consideration the height of the new added element.
For doing this i modified the original sub of CostomListView like this:
The problem is that even if FinalPosition is a number greater than 0 the instruction GetScrollViewOffset give me always 0.
(The number of items in the CustomListView are dozens, so i can scroll manually trough them and i expect that SetScrollViewOffset(FinalPosition) works correctly)
How can i obtain the correct value from GetScrollViewOffset that i have just set?
i am trying to add many items to index 0 of a XUI CustomListView and immediately after each item added i want to scroll to the previous offset, taking into consideration the height of the new added element.
For doing this i modified the original sub of CostomListView like this:
B4X:
Private Sub InsertAtImpl(Index As Int, Pnl As B4XView, ItemSize As Int, Value As Object, InitialSize As Int)
Dim InitialPosition As Float
Dim FinalPosition As Float
InitialPosition = GetScrollViewOffset
.........<Original code Here>.......
FinalPosition = InitialPosition + p.Height + IncludeDividierHeight
SetScrollViewOffset(FinalPosition)
Log("New Position: " & GetScrollViewOffset)
End Sub
The problem is that even if FinalPosition is a number greater than 0 the instruction GetScrollViewOffset give me always 0.
(The number of items in the CustomListView are dozens, so i can scroll manually trough them and i expect that SetScrollViewOffset(FinalPosition) works correctly)
How can i obtain the correct value from GetScrollViewOffset that i have just set?