글목록

2014. 8. 8.

How to hide status bar in ios 7




- (void)viewDidLoad
{
    [super viewDidLoad];
// Do any additional setup after loading the view.
    
    //viewDidload
    if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
        // iOS 7
        [self prefersStatusBarHidden];
        [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
    } else {
        // iOS 6
        [[UIApplication sharedApplicationsetStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
    }
    
}
// Add this Method
- (BOOL)prefersStatusBarHidden
{
    return YES;
}


 OR
 
XXXX - info.plist

 Status bar is initially hidden = YES

 View controller-based status bar appearance = NO






댓글 없음:

댓글 쓰기