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:
label1.Font = Font.CreateFontAwesome(12)
label1.Font = Font.CreateNew2("FontAwesome", 12)

but neither of them is working.
 

Semen Matusovskiy

Well-Known Member
Licensed User
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

Chris Guanzon

Active Member
Licensed User
Longtime User
@Erel @Semen Matusovskiy

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


B4X:
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
Top