Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

iOS Status Bar - How to make it dark (on light background)

Discussion in 'iOS and tvOS' started by rtilton1, Jun 25, 2020.

  1. rtilton1

    rtilton1

    Joined:
    Jan 4, 2017
    Posts:
    62
    I can't seem to figure out how to allow the status bar to be shown and be dark. I have a white background and no matter what it seems the status bar is also white. In XCode I also went to the info panel and tried to change 'status bar style', but still it's white!

    Any help would be greatly appreciated.
     
  2. rtilton1

    rtilton1

    Joined:
    Jan 4, 2017
    Posts:
    62
    I just tried putting everything on a black background and then the status bar showed up as black. Then I changed the status bar style to light and it worked. However it seems like if I have a white background and change the status bar style to dark it doesn't work....
     
  3. lrtrime

    lrtrime

    Joined:
    Sep 16, 2020
    Posts:
    7
    Hey!
    Same problem here. Have you found a solution for dark status bar on white background?
     
  4. szopu

    szopu

    Joined:
    Dec 28, 2019
    Posts:
    1
    You can change that in xcode by adding View Controller Based Status Bar Appearance to the Info.plist and setting it to NO. Then when you change the style to light or dark it shows correctly.
     
  5. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    I know this is an old thread but I'm having an issue with the Status Bar Style.

    I only have two options :

    Default
    Light

    So I'm missing:

    Dark

    Why was the Dark version removed? How can we bring it back?

    Edit: I'm using Unity 2021.3.8f1
     
    Last edited: Apr 25, 2023
    marcozakaria likes this.
  6. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    Default is mapping to UIStatusBarStyleDefault which is "A status bar that automatically chooses light or dark content based on the user interface style."
    As for why dark was removed: this is apple tweaking UIStatusBarStyle, deprecating old enums and leaving only default and light. They added back UIStatusBarStyleDarkContent in ios13 (we missed it indeed). If you feel brave
    in Trampoline Classes/UI/UnityViewControllerBase+iOS.mm
    search for
    - (UIStatusBarStyle)preferredStatusBarStyle
    and tweak implementation to just return UIStatusBarStyleDarkContent (note! if you are on 21.3 and min ios version is below ios13 you would need to wrap into @available block)
     
    marcozakaria likes this.
  7. marcozakaria

    marcozakaria

    Joined:
    Sep 17, 2017
    Posts:
    22
    I am currently making status bar style default but it always make its color white , doesn't change text color according to content color
    using Unity 2021.3.7 @Alexey

    upload_2023-8-25_22-18-15.png upload_2023-8-25_22-18-44.png
     
    Last edited: Aug 27, 2023