iOS Code Snippet Full screen apps

Discussion in 'iOS Code Snippets' started by Erel, Dec 7, 2014.

  1. Erel

    Erel Administrator Staff Member Licensed User

    You can hide the status bar by following these steps:

    1. Add this attribute:
    Code:
    #PlistExtra: <key>UIViewControllerBasedStatusBarAppearance</key><false/>
    2. Add this code:
    Code:
    Dim no As NativeObject = app
    no.RunMethod(
    "setStatusBarHidden:animated:"Array(TrueFalse))
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Setting the status bar to use a light theme:
    Code:
    Sub SetStatusBarStyleLight
       
    Dim no As NativeObject = app
       no.RunMethod(
    "setStatusBarStyle:"Array(1))
    End Sub
    Make sure to add the attribute from the first post.
     
    MikeH likes this.
  3. JackKirk

    JackKirk Well-Known Member Licensed User

    Is there a way to determine status bar state?

    I would like to:

    (1) Determine status bar state.
    (2) If visible - hide it via post #1.
    (3) Do stuff.
    (4) If was originally visible - reshow it.

    Thanks...
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    Sub IsStatusBarHidden As Boolean
       
    Dim no As NativeObject = App
       
    Return no.GetField("statusBarHidden").AsBoolean
    End Sub
     
    cosmobug likes this.
  5. JackKirk

    JackKirk Well-Known Member Licensed User

    After you hide the status bar as per post #1, how do you show it again?
    Code:
    Dim no As NativeObject = app
    no.RunMethod(
    "setStatusBarHidden:animated:"Array(FalseFalse))
    doesn't seem to work - or it may be putting up a blank status bar.

    I've googled without success.

    BTW it appears that setStatusBarHidden:animated is well and truly deprecated so is a more up to date means possible?

    Thanks in advance...
     
    Last edited: Mar 16, 2019
  6. Erel

    Erel Administrator Staff Member Licensed User

    You should never post in old threads. Please start a new one.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice