Hi there,
I'm learning to use ODC Studio and I've created my first Mobile app using the Mobile UI Framework. I installed it on my phone, but I see that the Status bar on Android is White and I can't get it to match the screen color. That screen has a LayoutBlank. I've also attached a screenshot of the Extensibility configuration. Do you know what it could be or how to fix it?
Changing the status bar color in an ODC Studio Mobile app to match the screen color involves updating the Extensibility Configurations with the required JSON code or dynamically modifying the status bar properties using JavaScript.
Using Extensibility Configurations: In the Mobile UI Framework for ODC (OutSystems Developer Cloud), you can set the status bar's background color to match your screen color by defining it in the "Extensibility Configurations" property for your app. Navigate to the "Edit App Properties" interface in your ODC Studio (similar to the configuration window shown in ), and include the following JSON configuration:
{ "appConfigurations": { "android": { "systembars": { "style": "light", "backgroundColor": "#yourScreenColorHex" } } } }
Replace "#yourScreenColorHex" with the hexadecimal color code of your screen background (e.g., "#FFFFFF" for white). This setting will apply globally or to particular screens if scoped correctly Customize the application status bar.
"#yourScreenColorHex"
"#FFFFFF"
Dynamic Change Using JavaScript: If the screen color varies dynamically, you can use JavaScript and leverage the Cordova StatusBar plugin (available in ODC). In the OnInitialize event of your screen, apply the following JavaScript:
if (window.StatusBar) { const screenColor = '#yourScreenColorHex'; // Replace with dynamically calculated screen color window.StatusBar.backgroundColorByName(screenColor); window.StatusBar.styleDefault(); // Adjust based on the text/icon visibility } else { console.log("StatusBar plugin is not available"); }
Ensure the backgroundColorByName() method's parameter matches the screen hexadecimal color dynamically rendered during runtime How to change the value of extensibility configuration by javascript?.
backgroundColorByName()
Additional Notes:
styleDefault()
styleLightContent()
By adopting the above methods, you can ensure your status bar color in an ODC Studio Mobile app seamlessly matches the underlying screen colors.
I tried what the AI recommended (backgroundColor: "#ColorHex"), but it didn't work :(
hi @Alvaro Contreras
You can check below post:
https://www.outsystems.com/forums/discussion/56232/how-to-set-the-color-font-on-status-bar-dynamically-change-based-on-the-backgroun/
https://success.outsystems.com/documentation/11/deploying_apps/mobile_apps_packaging_and_delivery/customize_your_mobile_app/customize_the_application_status_bar/
I hope this helps
Thanks
Hello @Alvaro Contreras ,
Could you confirm if you’re using MABS 12 or 11? In MABS 12, the WebView no longer overlays the system bars, and the cordova-plugin-statusbar was removed. The status bar now follows the system behavior and defaults to the app’s primary color (customizable via StatusBarBackgroundColor).