Using these subs I found in the forum:
With this, BarButton_Click is fired.
Dim lbHamburger As BarButton = CreateFABarIcon(Chr(0xF0C9),"Menu")
But with this, it does not? I do not see why there is a difference.
Dim lbHamburger As BarButton = CreateFABarImg("hamburger.png","Menu")
B4X:
Private Sub BarButton_Click
Dim b As Button = Sender
Log("Toolbar Click Tag = " & b.Tag)
mnu.MenuClick("Menu")
End Sub
Public Sub CreateFABarIcon(text As String, tag As Object) As BarButton
Dim bb As BarButton
Dim b As Button
b.InitializeCustom("BarButton", Colors.White, Colors.RGB(16,116,74))
b.CustomLabel.Font = Font.CreateNew2("FontAwesome", 32)
b.Text = text
b.Tag = tag
b.SetLayoutAnimated(0, 1, 0, 0, 24, 24)
bb.InitializeCustom(b)
Return bb
End Sub
Private Sub CreateFABarImg(sFile As String, tag As Object) As BarButton
Dim bb As BarButton
Dim b As ImageView
b.Initialize("img")
b.Bitmap=LoadBitmap(File.DirAssets,sFile)
b.Tag = tag
b.SetLayoutAnimated(0, 1, 0, 0, 24, 24)
bb.InitializeCustom(b)
Return bb
End Sub
With this, BarButton_Click is fired.
Dim lbHamburger As BarButton = CreateFABarIcon(Chr(0xF0C9),"Menu")
But with this, it does not? I do not see why there is a difference.
Dim lbHamburger As BarButton = CreateFABarImg("hamburger.png","Menu")