Android Question B4XPage colorBackground ToolbarMenu

Pesciolina

Active Member
Licensed User
hello everyone,
i'm migrating my app to B4XPage and i can't find how to set the colorBackground of the Toolbarmenu as now it comes out white and the text is white.
In the previous one I used the Theme.AppCompat.
this is the code of the Manifest
B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
   <color name="actionbar">#0098FF</color>
   <color name="statusbar">#0098FF</color>
   <color name="textColorPrimary">#fff</color>
   <color name="navigationBar">#0098FF</color>
 </resources>
)
CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
     </style>
    
    
</resources>
)
also in the output msg the text is white
Thank you
 

Attachments

  • Main.jpg
    Main.jpg
    296.8 KB · Views: 78
  • Menu.jpg
    Menu.jpg
    169.1 KB · Views: 83
  • msg.jpg
    msg.jpg
    424.5 KB · Views: 81

Pesciolina

Active Member
Licensed User
now the dialogs have the color i want.
Instead the background of the menu remains white

B4X:
CreateResource(values, colors.xml,
<resources>
   <color name="actionbar">#0098FF</color>
   <color name="statusbar">#0098FF</color>
   <color name="textColorPrimary">#fff</color>
   <color name="navigationBar">#0098FF</color>
 </resources>
)
CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
        <item name="android:colorBackgroundFloating">@color/actionbar</item>
     </style>
    
    
</resources>
)
 

Attachments

  • Menu.jpg
    Menu.jpg
    169.1 KB · Views: 60
Upvote 0
Top