iOS Question Converting a listview to a tableview

Sanxion

Active Member
Licensed User
Longtime User
Hi all

I would like to convert a B4a listview to a tableview:

I load the listview using the following:

lvLessons.AddSingleLine("Chapter1")
lvLessons.AddSingleLine("Chapter2")

etc...

I have defined a tableview and initialized it. Do I need to use table cells in order to add the lines?

Thanks
 

Sanxion

Active Member
Licensed User
Longtime User
All items are made of TableCells however you can ignore this fact and just add the items with:
B4X:
tv.AddSingleLine("Chapter1")
This is what I did initially but then couldn't determine how to handle the "click event" of the TableView and what arguments that event would take.

Could you give an example please?
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
I have found one way of doing it:

B4X:
Sub lvLessons_SelectedChanged (SectionIndex As Int, Cell As TableCell)
 
  Dim text As AttributedString = Cell.Text

End Sub
 
Upvote 0
Top