Search Unity

IOS 7 hide status bar

Discussion in 'Editor & General Support' started by stanislav-osipov, Sep 19, 2013.

  1. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hi guys.

    If you will build your game on IOS 7 you will probably note that status bar is not hidden, event if you have selected "hide status bar" on player build settings.

    Here is quick fix for this.

    Open iPhone_View.mm file and add this function
    Code (csharp):
    1.  
    2. - (BOOL)prefersStatusBarHidden
    3. {
    4.     return YES;
    5. }
    6.  
    to the UnityViewController implementation

    $Unity-iPhone.xcodeproj — iPhone_View.png

    I sure Unity will fix this shortly, but in the meantime this will work until Unity fix.
     
  2. Taryndactyl

    Taryndactyl

    Joined:
    Jan 26, 2013
    Posts:
    16
    Good find and thanks for sharing!
     
  3. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Just ran into this issue.
    Thanks lacost!
     
  4. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Just noticed this seems to be fixed in 4.2.1, yeay!

    4.2.1 release notes

    "iOS: Fixed status bar appearance on iOS 7."
     
  5. Cawas

    Cawas

    Joined:
    Jan 14, 2010
    Posts:
    121
    You can also edit info.plist and add a new line:
    Code (csharp):
    1.  
    2. View controller-based status bar appearance    Boolean    NO
    3.  
     
  6. ck_ch

    ck_ch

    Joined:
    Oct 17, 2013
    Posts:
    1
    Set the value UIViewControllerBasedStatusBarAppearance to NO in your Info.plist, this should suffice.
     
    Last edited: Oct 22, 2013
  7. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Cool info.

    Is there a way to toggle the status bar on/off in unity for IOS 6 +.

    My use case is that I would like for the user to have the option to see the battery life while the game is playing. Being able to Hide/Display the status bar would be great.

    Cheers