B4J Question ABMaterial - Navigation Bar

Johan Schoeman

Expert
Licensed User
Longtime User
So, I am a dummy when it come to ABMaterial but have thought that I will try and give this masterpiece by @alwaysbusy (Alain) a test drive.

One simple thing that I juts cannot find a solution for is how to add an image or logo in the Left Top of the Navigationbar. I have disabled the sidebar by commenting:

B4X:
'    page.NavigationBar.AddSideBarItem("DUMMY", "{NBSP}", "", "")                      'now the hamburger button is gone!

I have this code in BuildNavigationBar but the image/logo does not show:

B4X:
    Dim sbtopimg As ABMImage
    sbtopimg.Initialize(page, "sbtopimg", logo, 1)
'    Log("LOGO = " & logo)
    sbtopimg.SetFixedSize(236, 49)   

    page.NavigationBar.Initialize(page, "nav1", ABM.SIDEBAR_MANUAL_HIDEMEDIUMSMALL, Title, False, True, 330, 48, sbtopimg, ABM.COLLAPSE_NONE, "navbartheme")

What am I missing? I don't want the sidebar but need to add an image/logo (png) to the left top of the Navigationbar

Tx

JS


upload_2019-2-17_12-39-2.png
 

Harris

Expert
Licensed User
Longtime User
The logo image shows (only) when the Navigation Sidebar is shown - which your code does not do...
The title label is shown in this location (plain text - not an image!).
There are workarounds, but not so simple or elegant...

Search the forum for alternatives.

Thanks
 
Upvote 0
Top