Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Set colour of status bar for Android

Set colour of status bar for Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 5 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tuesday
    wrote on last edited by
    #1

    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?

    D raven-worxR 2 Replies Last reply
    0
    • T tuesday

      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?

      D Offline
      D Offline
      Devopia53
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • T tuesday

        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?

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @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.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        T 1 Reply Last reply
        1
        • raven-worxR raven-worx

          @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.

          T Offline
          T Offline
          tuesday
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Schluchti
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • GTDevG Offline
              GTDevG Offline
              GTDev
              wrote on last edited by GTDev
              #6

              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

              Senior Developer at Felgo - https://felgo.com/qt

              Develop mobile Apps for iOS & Android with Qt
              Felgo is an official Qt Technology Partner

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved