I have added an image to my title bar and I want to change it at run time. I have had a guess but not had any success. Can someone show me the correct way to do it?
In B4XPage_Created:
B4X:
Public mi As B4AMenuItem = B4XPages.AddMenuItem(Me, "btnws")
mi.AddToBar = True
mi.Bitmap = xui.LoadBitmapResize(File.DirAssets, "gy.png", 24dip, 24dip, True)
for now as a test in B4XPage_MenuClick:
B4X:
If Tag = "btnws" Then
Dim menus As List = B4XPages.GetManager.GetPageInfoFromRoot(Root).Parent.MenuItems
For Each m As B4AMenuItem In menus
If m.Tag = "btnws" Then
Log("menu")
m.Bitmap = xui.LoadBitmapResize(File.DirAssets, "gn.png", 24dip, 24dip, True)
End If
'
Next