This snippet works for me but it's just a workaround. Are there any updates about measuring the needed width to show the complete text (single line)?
Note: I need to use TextFields in a TableView to let the user edit the data fast.
Note: I need to use TextFields in a TableView to let the user edit the data fast.
B4X:
Private Sub MeasureTextWidth (Text As String, Font As Font) As Float
Dim lbl As Label
lbl.Initialize("")
lbl.Text = Text
lbl.Font = Font
MainForm.RootPane.AddNode(lbl, 0, 0, -1, -1) 'mBase is a B4XView panel.
lbl.Snapshot
lbl.RemoveNodeFromParent
Return lbl.Width
End Sub