Dim XI As XUI
'Doesn't work?
Dim TargetHeight As Int = 10dip
'Works ok.
'Dim TargetHeight As Int = 40dip
Dim pControl As CustomListView
Dim PropList As CustomListViewProp
PropList.Initialize
PropList.InsertAnimationDuration=100
PropList.ShowScrollBar=False
PropList.ListOrientation=PropList.XLIST_ORIENTATION_HORIZONTAL
PropList.PressedColor=XI.Color_Blue
PropList.DividerHeight=0
pControl.Initialize(Me,"pControl")
Dim TestPane As Pane
TestPane.Initialize("TestPane")
Dim View As B4XView=TestPane
View.Color=XI.Color_Green
Dim TempLabel As Label
TempLabel.Initialize("TempLabel")
Dim View As B4XView=TempLabel
View.Color=XI.Color_Magenta
TempLabel.Visible=False
MainForm.RootPane.AddNode(TestPane,30dip,30dip,500dip,TargetHeight-2)
pControl.DesignerCreateView(TestPane,TempLabel,PropList.Map)
Dim sv As ScrollPane=pControl.sv
sv.FitToHeight=True
sv.PrefHeight=TargetHeight
Dim ShowCyan As Boolean
For i = 1 To 100
Dim newItemPane2 As Pane
newItemPane2.Initialize("newItemPane2")
newItemPane2.PrefWidth=TargetHeight
newItemPane2.Style="-fx-border-color: red;-fx-border-width: 1;"
Dim View3 As B4XView=newItemPane2
If ShowCyan Then
View3.Color=XI.Color_Cyan
ShowCyan=False
Else
View3.Color=XI.Color_Blue
ShowCyan=True
End If
pControl.Add(View3,i)
Next