Android Question xcustomelistview set specific item visibility

Addo

Well-Known Member
Licensed User
i am creating items like following

B4X:
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
   Dim p As Panel
   p.Initialize("")
   p.SetLayout(0, 0, Width, Height)
   p.LoadLayout("cellitem")
   label1.Text = " Name "
   labelnumber.Text = "100 "
   Return p
End Sub

i am trying to set some items visible to False how can i do that programmatically based on items index ?
 

LucaMs

Expert
Licensed User
Longtime User
You can call RemoveAt to remove an item and later add it back with InsertAt.
This the "most quick way", of course (you have to store the item and its index, in a "List of type tXXXItem).

A better solution would be to add a method like SetItemVisibility(Visible As Boolean).

The tag property is already used; maybe we can create an internal type, to store the Index and Visible.
Then the ItemVisibility routine should be very similar to RemovaAt.

I know, it's a "lot" of work.
 
Upvote 0
Top