W walt61 Well-Known Member Licensed User Longtime User Dec 23, 2016 #1 Hi all, Is it possible to define a label with TypeFace FontAwesome or MaterialIcons in code? I was aiming for e.g. Code: Dim lblMaterial As Label lblMaterial.Initialize("") lblMaterial.Typeface = Typeface.??? but then got stuck. Thanks !
Hi all, Is it possible to define a label with TypeFace FontAwesome or MaterialIcons in code? I was aiming for e.g. Code: Dim lblMaterial As Label lblMaterial.Initialize("") lblMaterial.Typeface = Typeface.??? but then got stuck. Thanks !
mangojack Expert Licensed User Longtime User Dec 24, 2016 #2 Create a Invisible Label in Designer and set its Typeface to FontAwesome or MaterialIcons. Then ... lblMatrial.Typeface = InvisibleLabel.Typeface. See here ..https://www.b4x.com/android/forum/t...material-icons-fonts.72908/page-2#post-470862 and ... https://www.b4x.com/android/forum/threads/fontawesome.74361/#post-472227 Upvote 0
Create a Invisible Label in Designer and set its Typeface to FontAwesome or MaterialIcons. Then ... lblMatrial.Typeface = InvisibleLabel.Typeface. See here ..https://www.b4x.com/android/forum/t...material-icons-fonts.72908/page-2#post-470862 and ... https://www.b4x.com/android/forum/threads/fontawesome.74361/#post-472227
W walt61 Well-Known Member Licensed User Longtime User Dec 24, 2016 #3 Thanks @mangojack, I've seen those and knew them, but that's via the Designer. If possible, I'd like to have them purely *in code*. Upvote 0
Thanks @mangojack, I've seen those and knew them, but that's via the Designer. If possible, I'd like to have them purely *in code*.
DonManfred Expert Licensed User Longtime User Dec 24, 2016 #4 walt61 said: I'd like to have them purely *in code*. Click to expand... i did not see a way just in Code. But your can use Iconify lib to do that Upvote 0
walt61 said: I'd like to have them purely *in code*. Click to expand... i did not see a way just in Code. But your can use Iconify lib to do that
W walt61 Well-Known Member Licensed User Longtime User Dec 24, 2016 #5 Thanks @DonManfred, I might give that a go indeed; I didn't see a way to do it in code either (obviously ) Upvote 0
Thanks @DonManfred, I might give that a go indeed; I didn't see a way to do it in code either (obviously )
D diego Member Licensed User Longtime User Jan 25, 2017 #6 I've also tried to modify the "text" of the label but unsuccessfully, if I use http://fontawesome.io/cheatsheet/ code or alias I get a label with that text. Code: Select level case < 20 'lblBat.Text = "fa-battery-1" lblBat.Text = "" ... End Select Upvote 0
I've also tried to modify the "text" of the label but unsuccessfully, if I use http://fontawesome.io/cheatsheet/ code or alias I get a label with that text. Code: Select level case < 20 'lblBat.Text = "fa-battery-1" lblBat.Text = "" ... End Select
W walt61 Well-Known Member Licensed User Longtime User Jan 25, 2017 #7 Indeed, but the label itself would need to be defined in the Designer, it appears it can't be done in code. Something that might help you search the fonts: https://www.b4x.com/android/forum/t...l-search-fontawesome-and-material-icons.75193 Upvote 0
Indeed, but the label itself would need to be defined in the Designer, it appears it can't be done in code. Something that might help you search the fonts: https://www.b4x.com/android/forum/t...l-search-fontawesome-and-material-icons.75193
D diego Member Licensed User Longtime User Jan 25, 2017 #8 solved with a workaround: several labels .visible = False and set one of them .visible = True. thanks for the link, very useful! Last edited: Jan 25, 2017 Upvote 0
solved with a workaround: several labels .visible = False and set one of them .visible = True. thanks for the link, very useful!