B4J Question TableView: column width / measure nec. width / wrap text

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can enable text wrapping if you use labels for the items:

SS-2017-10-08_13.30.03.png


B4X:
'See TableView tutorial: https://www.b4x.com/android/forum/threads/tableview-tutorial.35542/
Sub CreateRow(Row() As String) As Object()
   Dim labels(Row.Length) As Object
   For i = 0 To Row.Length - 1
     Dim lbl As Label
     lbl.Initialize("")
     lbl.Text = Row(i)
     lbl.WrapText = True '<---set to true
     labels(i) = lbl
   Next
   Return labels
End Sub

You can set the rows height with a css file:
B4X:
.table-row-cell {
  -fx-cell-size: 100px;
}
 
Upvote 0
Top