iOS Question CS Builder

monic

Active Member
Licensed User
Longtime User
I've been trying to convert the following from B4A to B4I and I haven't been successful.

B4A:

B4X:
Sub CreateLabel(Label As Label, Text1 As String, Text2 As String) As B4XBitmap
    Dim cs As CSBuilder
    cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(30).Append(Text1).Pop.Append(CRLF).Size(10).Append(Text2).Alignment("ALIGN_CENTER").PopAll
    xlbl = Label
    xlbl.Text = cs
    xlbl.TextColor = xui.Color_RGB(105, 105, 105)
    Return xlbl.Snapshot
End Sub

B4I Attempt! I missed out the second size ten as it was complaining.

B4X:
Sub CreateLabel(Label As Label, Text1 As String, Text2 As String) As B4XBitmap
    Dim cs As CSBuilder
    cs.Initialize.Font(Font.CreateFontAwesome(30)).Append(Text1).Pop.Append(CRLF).Append(Text2).Alignment("ALIGN_CENTER").PopAll
    xlbl = Label
    xlbl.Text = cs
    xlbl.TextColor = xui.Color_RGB(105, 105, 105)
    Return xlbl.Snapshot
End Sub

I get <B4I... instead of the awesome font
 
Last edited:
Top