B4J Question About Tableview

moore_it

Well-Known Member
Licensed User
Longtime User
Hi all,

it's possible to ad a icon at the column header of the tableview ?

Thanks in advice
Toni
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use this code to put a Node in the column header:
B4X:
Sub SetColumnGraphic(tv As TableView, Index As Int, Node As Node)
   Dim jo As JavaObject = tv
   Dim column As JavaObject = jo.RunMethodJO("getColumns", Null).RunMethod("get", Array(Index))
   column.RunMethod("setGraphic", Array(Node))
End Sub

Example:
B4X:
Dim b As Button
b.Initialize("b")
b.SetLayoutAnimated(0, 0, 0, 100, 50)
b.Text = "Click"
SetColumnGraphic(TableView1, 1, b)

You can use ImageView to put an image.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…