iOS Question CS Builder

Discussion in 'iOS Questions' started by Jamie8763, Aug 8, 2018.

  1. Jamie8763

    Jamie8763 Member Licensed User

    I've been trying to convert the following from B4A to B4I and I haven't been successful.

    B4A:

    Code:
    Sub CreateLabel(Label As Label, Text1 As String, Text2 As StringAs 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(
    105105105)
        
    Return xlbl.Snapshot
    End Sub
    B4I Attempt! I missed out the second size ten as it was complaining.

    Code:
    Sub CreateLabel(Label As Label, Text1 As String, Text2 As StringAs 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(
    105105105)
        
    Return xlbl.Snapshot
    End Sub
    I get <B4I... instead of the awesome font
     
    Last edited: Aug 8, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice