B4J Question How to hide the TableView columns header?

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use this code:
B4X:
Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
   Private TableView1 As TableView
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.Show
   MainForm.RootPane.LoadLayout("1")
   TableView1.SetColumns(Array As String("col 1", "col 2"))
   TableView1.Items.Add(Array As String("1", "2"))
   
End Sub

Sub TableView1_Resize (Width As Double, Height As Double)
   HideHeaders(TableView1)
End Sub

Sub HideHeaders(tv As TableView)
   Dim jtable As JavaObject = tv
   Dim header As Pane = jtable.RunMethod("lookup", Array As Object("TableHeaderRow"))
   header.PrefHeight = 0
   header.Visible = False
End Sub
 
Upvote 0
Top