[Tutorial] Removing the Status Bar

Discussion in 'iOS Development' started by JoshuaCaputo, Jan 19, 2009.

  1. Steaps New Member

    Member Since:
    Oct 24, 2007
    Message Count:
    5,075
    Device:
    iPod touch
    I use the Info.plist way because i couldn't figure out where to put the
    Code:
    [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; 
    
    :eek:.
    If you know how, could you include it in the tutorial?
  2. JoshuaCaputo New Member

    Member Since:
    Aug 2, 2008
    Message Count:
    605
    Device:
    iPod touch
    in viewDidLoad or similar functions. Something that happens immediately.
  3. Steaps New Member

    Member Since:
    Oct 24, 2007
    Message Count:
    5,075
    Device:
    iPod touch
    Haha i went and tried it after i posted that, got it. Thanks :).
  4. gojohnnyboi Well-Known Member

    Member Since:
    Jan 25, 2008
    Message Count:
    3,353

    In your application delegate class, where everything is called when the application loads:

    Code:
    - (void)applicationDidFinishLaunching:(UIApplication *)theApplication;
    that would most likely be a good time to =]
  5. SkylarEC Super Moderator Emeritus

    Member Since:
    Sep 19, 2007
    Message Count:
    6,640
    No, cocotuch, you are wrong. If you disable it in the plist, you can easily add/change the status bar in code. It is only a temporary thing.

    My point was that you should learn how to do this in code so that you can do things in code when you need to.
  6. Manny05 New Member

    Member Since:
    Feb 10, 2009
    Message Count:
    242
    Device:
    iPhone 4 (Black)
    I have Vanilla surf and when you use the full screen feature, the status bar is still there..
    is there any way i can get rid of the status bar when i am in full screen mode?
  7. gojohnnyboi Well-Known Member

    Member Since:
    Jan 25, 2008
    Message Count:
    3,353
    Code:
    - (void)applicationDidFinishLaunching:(UIApplication *)theApplication {
    
    application.statusBarHidden = YES;
    
    // rest of code
    }
  8. ipodtouchmaster05 Well-Known Member

    Member Since:
    Sep 30, 2007
    Message Count:
    1,791
    Device:
    iPhone 4 (Black)
    Actually it would be:
    Code:
    - (void)applicationDidFinishLaunching:(UIApplication *)theApplication {
    
    theApplication.statusBarHidden = YES;
    
    // rest of code
    }
    ;)
  9. SkylarEC Super Moderator Emeritus

    Member Since:
    Sep 19, 2007
    Message Count:
    6,640
    setStatusBarHidden:bool animated:anotherBool
  10. gojohnnyboi Well-Known Member

    Member Since:
    Jan 25, 2008
    Message Count:
    3,353
    It CAN be done that way, but why not just set this property on the UIApplication passed in applicationDidFinishLauncing:

    Unless setting this automatically makes it animated(I am not sure if it does or not)

    @property(nonatomic,getter=isStatusBarHidden) BOOL statusBarHidden;