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. Qt on iOS: Status Bar Color
Forum Updated to NodeBB v4.3 + New Features

Qt on iOS: Status Bar Color

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 4 Posters 4.8k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    austinsimpson
    wrote on last edited by
    #1

    Hi all,

    First, I would just like to thank you for at least taking the time to read this.

    I would like to clarify what I am referring to by saying "status bar", because I know that there is some ambiguity as to what a status bar could be. For my case, I am talking about the 20px high bar that shows battery information, time, carrier, etc. I want to set the color of the status bar to make the app look native.

    Typically, as of iOS 7, the color of the status bar show the color of the application's UINavigationBar. With Qt, I don't think that I have access to this. With a typical Cocoa application, the code would simply look like this:

    @ [[UINavigationBar appearance] setBarTintColor:[UIColor yellowColor]];@

    There is also a property in Xcode called "View controller-based status bar appearance" that you can set to "NO", and this will make the color of the status bar independent from the navigation bar. However, I'm not aware of any way to set the color from this approach.

    Again, I would like to say that this problem is just nit-picky and trivial, but my app would look better if I can manage to change the status bar color.

    Is anyone able to point me in the right direction or offer suggestions?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jimcad
      wrote on last edited by
      #2

      I have a same problem. Did you find a solution to change it?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        austinsimpson
        wrote on last edited by
        #3

        No, I haven't found a solution yet. For now I have the status bar set to hidden in the info.plist file. I have a QML item that does the same thing as a UINavigationBar, and I just made that a bit higher.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jimcad
          wrote on last edited by
          #4

          Ok. Thanks for info.

          1 Reply Last reply
          0
          • benlauB Offline
            benlauB Offline
            benlau
            Qt Champions 2016
            wrote on last edited by
            #5

            In case you are still looking for a solution of this problem...

            In fact, what you need is set "UIViewControllerBasedStatusBarAppearance" be false in Info.plist. Then show your application in full screen mode and draw the status bar background by yourself.

            The following commit has demonstrated how to set Info.plist:

            https://github.com/benlau/quickios/commit/c8a3eb5744ba8b19aeb8b8d8babd9f8200d7455e

            p.s the project is not usable yet.

            1 Reply Last reply
            0
            • benlauB Offline
              benlauB Offline
              benlau
              Qt Champions 2016
              wrote on last edited by
              #6

              In case you are still looking for a solution of this problem...

              In fact, what you need is set "UIViewControllerBasedStatusBarAppearance" be false in Info.plist. Then show your application in full screen mode and draw the status bar background by yourself.

              The following commit has demonstrated how to set Info.plist:

              https://github.com/benlau/quickios/commit/c8a3eb5744ba8b19aeb8b8d8babd9f8200d7455e

              p.s the project is not usable yet.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi,

                About this

                @ [[UINavigationBar appearance] setBarTintColor:[UIColor yellowColor]];@

                You can mix C++ and Objective-C code so it's probably working (haven't checked though)

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi,

                  About this

                  @ [[UINavigationBar appearance] setBarTintColor:[UIColor yellowColor]];@

                  You can mix C++ and Objective-C code so it's probably working (haven't checked though)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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