Unsolved Set colour of status bar for Android
-
Hi,
I'm using Qt Quick Controls 2, and would like to change the colour of the status bar to follow the Material Design look. Even after calling QQuickStyle::setStyle("Material"), the colour is black, but it should be a darker shade of the action bar. I implemented this workaround, but it would still show as black momentarily at the beginning.
Is there a way to set the colour beforehand so the status bar is never black?
-
This post is deleted! -
@tuesday said in Set colour of status bar for Android:
Is there a way to set the colour beforehand so the status bar is never black?
you can set it via the manifest/style xml file.
There are plenty of resources how to do that on the web. -
@raven-worx said in Set colour of status bar for Android:
@tuesday said in Set colour of status bar for Android:
Is there a way to set the colour beforehand so the status bar is never black?
you can set it via the manifest/style xml file.
There are plenty of resources how to do that on the web.I think I tried that already. You mean create a 'styles.xml' file under android/res/values right? This is the style I tried:
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault"> <item name="android:colorPrimaryDark">#303F9F</item> <item name="android:statusBarColor">#303F9F</item> </style>
I added it as a style in the application tag of the manifest file.
-
This post is deleted! -
You can also have a look at V-Play Apps SDK, which allows to change the tint color for the navigation- and status-bar from within QML.
E.g.:
import VPlayApps 1.0 App { // change the tint onInitTheme: { Theme.colors.tintColor = "green" } // empty page with navigation bar NavigationStack { Page { title: "Dummy Page" } } }
Cheers, Günther