Android Question Problem defining menu color in manifest

Gabino A. de la Gala

Well-Known Member
Licensed User
Longtime User
I am defining the different colors in the Manifest but I have not found yet how to define the background color of the options list when I display the menu.

I'm using the example code of this thread: https://www.b4x.com/android/forum/threads/theme-colors.87716/

I only changed it adding:

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Activity.AddMenuItem3("", "refresh", LoadBitmapResize(File.DirAssets, "ic_cached_white_24dp.png", 32dip, 32dip, True), True)
    Activity.AddMenuItem3("", "done", LoadBitmapResize(File.DirAssets, "ic_done_white_24dp.png", 32dip, 32dip, True), True)

    ' NEW LINES ADDED
    Activity.AddMenuItem("Opcion 1", "OP1")
    Activity.AddMenuItem("Opcion 2", "OP2")
    Activity.AddMenuItem("Opcion 3", "OP3")
End Sub
 

Attachments

  • Captura1.JPG
    Captura1.JPG
    27.7 KB · Views: 126

Gabino A. de la Gala

Well-Known Member
Licensed User
Longtime User
At the moment I managed to add the following line to the manifest:

B4X:
<item name = "android: colorBackground"> @ color / statusbar </item>

This changed the background color of the entire application, not just the menu. But in my case it was even good for me.
 
Upvote 0
Top