Private Sub CreateLabel(txt As Object) As B4XView
Dim lbl As Label
lbl.Initialize("")
lbl.TextAlignment = DesignerLabel.TextAlignment
lbl.Font = DesignerLabel.Font
lbl.Multiline = True
lbl.TextColor = DefaultTextColor
If txt Is AttributedString Then
lbl.AttributedText = txt
Else
lbl.Text = txt
End If
lbl.Width = sv.ScrollViewContentWidth - 10dip
lbl.SizeToFit
Return lbl
End Sub