iOS Question ScrollToItem when use PreoptimizedCLV

david7374

Member
Hi,
How to ScrollToItem when use PreoptimizedCLV??
When I remove PreoptimizedCLV and use this code, it works perfect.
ScrollToItem:
CLV.ScrollToItem(pos1)
But, it not works when use PreoptimizedCLV.
I also use this code.
ScrollToItem:
' PreoptimizedCLV completed
sleep(1000)
CLV.ScrollToItem(pos1)
But not work.
 

david7374

Member
I use this code to create:
B4X:
Sub load
    For i=0 To list1.Size-1
        PCLV.AddItem(200dip, xui.Color_Transparent, i)
    Next
    PCLV.Commit
End Sub

Sub recy_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
    For Each i As Int In PCLV.VisibleRangeChanged(FirstIndex, LastIndex)
        Dim item As CLVItem = recy.GetRawListItem(i)
        Dim pnl As B4XView = xui.CreatePanel("")
        'Create the item layout
        Dim height As Int = CreateItem(pnl,item.Value)
        'Create height
        item.Panel.AddView(pnl,0,0,Page1.RootPanel.Width,height)
        recy.ResizeItem(item.Value,height)
        'Create finish
    Next
End Sub
 
Upvote 0
Top