Hi Community, I am translating my app from B4a to B4i and since I am not yet familiar with B4i I am experiencing several problems. I have read some posts on xCustomListView and PreoptimizedCLV on B4i but can't seem to resolve. I am using the code from my B4a app which is working correctly. The first thing I did and replicate it on b4i without changes, I don't get any errors but the CustomListView is empty. Anyone know what I need to change in this code?
B4X:
Sub PC1_Init
PCLV1_View.Initialize(Me, "PCLV1_View", CustomListView1)
PCLV1_View.ShowScrollBar=False
For Each word As String In List1
PCLV1_View.AddItem(100dip, xui.Color_White, word)
Next
PCLV1_View.Commit
End Sub
Sub PCLV_HintRequested (Index As Int) As Object
Dim word As String = CustomListView1.GetValue(Index)
Return word
End Sub
Sub CustomListView1_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
For Each i As Int In PCLV1_View.VisibleRangeChanged(FirstIndex, LastIndex)
Dim item As CLVItem = CustomListView1.GetRawListItem(i)
Dim pnl As B4XView = xui.CreatePanel("")
item.Panel.AddView(pnl, 0, 0, item.Panel.Width,item.Panel.Height)
'Create the item layout
' ------------------------------------------------
lblpreis4.Initialize("")
lblpreis4.SetLayoutAnimated(0,0,0,0,20%x,12%x)
lblpreis4.TextColor=Colors.RGB(255,92,0)
pnl.LoadLayout("Layout1")
Dim formatter As B4XFormatter
formatter.Initialize
formatter.GetDefaultFormat.MaximumFractions = 2
formatter.GetDefaultFormat.MinimumFractions = 2
formatter.GetDefaultFormat.Postfix = "€"
For Each d As Double In Array(1, 10, 1000, 1.2)
LblPrezzo.Text=formatter.Format(Lista2.Get(i))
Next
LablAnti1.TextColor=Colors.Black
'LablAnti1.TextSize=16
'LablAnti1.Typeface=Typeface.DEFAULT_BOLD
LablAnti1.Text=item.Value
LAnti_desc1.TextColor=Colors.Black
LAnti_desc1.Text=Lista3.Get(i)
BTAddInOrder.InitializeCustom("BTAddInOrder",Colors.White,Colors.rgb(9,143,255))
BTAddInOrder.Text=LblPrezzo.Text
Next
End Sub