iOS Question Fontawesome in label

Chris Guanzon

Active Member
Licensed User
Longtime User
How to make the text in label become a fontawesome in runtime? I've tried these two codes

B4X: Copy
label1.Font = Font.CreateFontAwesome(12)
label1.Font = Font.CreateNew2("FontAwesome", 12)

but neither of them is working.
 
All variants should work. Meanwhile it's possible to imagine a million reasons, why the text is invisible. For example
1) incorrect parameters in ParentPanel.AddView (Label1, ...)
2) Label1.TextColor is the same as background color
3) Label1.Text includes incorrect symbols etc.
 
Upvote 0
@Erel @Semen Matusovskiy

I want to show the fontawesome in label inside the customlistview, below is my code


B4X: Copy
Sub CreateMenuList (MenuIcon As String, MenuName As String, Width As Int, Height As Int) As Panel
    Dim p As Panel
    p.Initialize("")
    p.SetLayoutAnimated(0, 0.1, 0, 0, Width, Height)
    p.LoadLayout("menu_item")

    Controls.SetGradient(lblMenuIcon, Variables.LabelGradientColor1, Variables.LabelGradientColor2)

    lblMenuIcon.Font = XUI.CreateFontAwesome(12)
    lblMenuIcon.Text = MenuIcon
    lblMenuName.Text = MenuName
    Return p
End Sub

private sub CreateMenuListItems
    CustomListView1.Add(CreateMenuList(Chr(0xF029), "Menu1", CustomListView1.AsView.Width, 60dip), 0)
End sub

what could be the problem?
 
Upvote 0
Back
Top