Android Question Change CustomListView row height

rraswisak

Active Member
Licensed User
Longtime User
Hi all,

I have a xCustomListView with three items, it has 200dip height each. I want to resize height (expand/collaps) at the item when arrow icon was click.

upload_2019-8-4_4-31-36.png


B4X:
Sub lblArrow_Click
   Dim itm As CLVItem
   Dim lbl As Label = Sender
   Dim idx As Int = clvTable.GetItemFromView(lbl)
   itm = clvTable.GetRawListItem(idx)
   itm.Panel.Height = 350dip 'new size, resize height from 200 to 350 dip
End Sub

The above code does not work, any idea ?

note:
- been looking Expandable List and CLVExpandable before, but it's to complex as for my current needed
 

mangojack

Expert
Licensed User
Longtime User
try ...
B4X:
Sub lblArrow_Click
    Dim index As Int = clvTable.GetItemFromView(Sender)  
    Dim height As Int = clvTable.GetPanel(index).Height
    If height = 200 Then
        height = 350dip
    Else
        height = 200dip
    End If
    clvTable.ResizeItem(index, height)
End Sub
 
Upvote 0

rraswisak

Active Member
Licensed User
Longtime User
@mangojack Thank you for your snippet code, i did not mention that xCustomListView has ResizeItem method which is that what i need. now after some modification i can get it work as expected.

table.gif


@Erel CLVExpandable act exacly what i want to do, but in my case i only use one panel with rounding corner in the layout, so if i use CLVExpandable there will be 2 rounded panel while expand
 
Upvote 0
Top