iOS Question [Solved] FontAwesome not working as button icons

Discussion in 'iOS Questions' started by emexes, May 7, 2019.

  1. emexes

    emexes Well-Known Member Licensed User

    (re: related thread: https://www.b4x.com/android/forum/threads/fontawesome-icons-in-buttons.80993/ )

    I had an issue where FontAwesome icons that looked great in Designer:

    [​IMG]

    were not displaying in the actual program:

    [​IMG]

    and what I eventually tracked it down to was a programming mistake/oversight on my part (hard to believe, I know ;-/ ) when resizing the button label:
    Code:
    Dim V As View
    For I = 0 To RootPanel.NumberOfViews - 1
        V = RootPanel.GetView(I)
               
        
    If V Is Button Then
            AsButton = V
            AsLabel = AsButton.CustomLabel

            
    '*** bad - font changed back to default font ***
            'AsLabel.Font = AsLabel.Font.CreateNew(AsLabel.Font.Size * TextScale)

            
    '*** good - font unchanged eg remains FontAwesome ***
            AsLabel.Font = AsLabel.Font.CreateNew2(AsLabel.Font.Name, AsLabel.Font.Size * TextScale)
    Presumably this issue would also apply where FontAwesome (or other iconic fonts) are used in labels etc too.
     
    techknight and Erel like this.
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