iOS Question How do I add a Header Section to TableView

davepamn

Active Member
Licensed User
I want to add a group Header section to a segment of tableview rows.

B4X:
Private tvContracts As TableView
Page2.RootPanel.AddView(tvContracts,0,300,100%x,70%y)
...
      If sOldContractNumber<>sContractNumber Then
           
            tvContracts.AddSection(sContractNumber,"")

        End If

        Dim tc As TableCell=tvContracts.AddSingleLine(sFieldNumber)

        tc.IndentationLevel=2
        Dim oDetailText As AttributedString
        oDetailText.Initialize(sFieldNumber,Font.CreateNew(30),Colors.Blue)
        tc.DetailText=oDetailText
        tc.Tag=sID
        sOldContractNumber=sContractNumber
...

tvContracts.ReloadAll
Each Contract Should be a Header Section that the user can not select.

I want each of the contract numbers to be a section.

Contract 1 (Section)
Field 2 (Two Line)
Field 3 (Two Line)

The font size does not work when I call reloadall. Am I suppose to change the font size while the table rows are loading through an event?
 
Last edited:

davepamn

Active Member
Licensed User
How do I change the font size and color of the sections?

The table cell Font size and color do not seem to be applying to the Single Line.

The tag value is working.
 
Last edited:

davepamn

Active Member
Licensed User
B4X:
'I need the b4a equivalent api
tvContracts.tw.TwoLinesLayout.Label.TextSize=30
'I found rowHeight
    tvContracts.RowHeight=50dip
 
Top