G ggranata Member Apr 27, 2020 #1 Hi, In my layout, I have defined a CustomListView and dynamically I populate the CLV with panels. How can I set different heights for CLV items? Can I change item height after CLV.Add? Attachments clvitem.PNG 12.8 KB · Views: 622 Screenshot_1588001699.png 104.2 KB · Views: 543
Hi, In my layout, I have defined a CustomListView and dynamically I populate the CLV with panels. How can I set different heights for CLV items? Can I change item height after CLV.Add?
mangojack Expert Licensed User Longtime User Apr 28, 2020 #2 I believe it would be simpler to calculate the desired panel height prior to loading the item. Then just pass the reqired panel height. Using the xCLV example... Code: Copy For i = 1 To 10 Dim Height As Int If i Mod 2 = 0 Then Height = 100 Else Height = 70 End If clv1.Add(CreateListItem($"${i}"$, clv1.AsView.Width, Height), $"Item #${i}"$) Next Upvote 0
I believe it would be simpler to calculate the desired panel height prior to loading the item. Then just pass the reqired panel height. Using the xCLV example... Code: Copy For i = 1 To 10 Dim Height As Int If i Mod 2 = 0 Then Height = 100 Else Height = 70 End If clv1.Add(CreateListItem($"${i}"$, clv1.AsView.Width, Height), $"Item #${i}"$) Next
Erel B4X founder Staff member Licensed User Longtime User Apr 28, 2020 #3 1. You should add 'dip' units. 2. You can resize items with clv.ResizeItem. Upvote 0