0

This question is not about hiding the status bar, but merely hiding the text of the status bar.

I could nt find it anywhere to approach this problem

UBER app does this, when we open the side menu in uber, the status bar text disappear,

JayVDiyk
  • 4,277
  • 22
  • 70
  • 135
  • 1
    I don't think there is a sanctioned way of doing this (i.e., public APIs). My guess is that Uber is just hiding the bar (using the standard methods), and placing instead a custom view of the same size and color, but without any labels/icons. – Nicolas Miari May 19 '16 at 04:55
  • I doubt that @NicolasMiari cause we can see that the text slides up. – JayVDiyk May 19 '16 at 04:56
  • 1
    I haven't seen the Uber app, but then they must be "sliding up" that text themselves (with a custom animation). The default status bar has a pretty much limited API: You can choose between two color styles and whether to show it or not (globally, or on a per-view controller basis). That is all. – Nicolas Miari May 19 '16 at 05:02

2 Answers2

2

No you can't hide text of status bar. you can hide status bar with animation something like,

  CGRect appFrame = [[UIScreen mainScreen] applicationFrame];

[UIView animateWithDuration:0.7 animations:^{

     [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
 //   self.navigationController.navigationBar.frame = self.navigationController.navigationBar.bounds;
    self.view.window.frame = CGRectMake(0, 0, appFrame.size.width, appFrame.size.height);
}];

It is in obj c and just for understand concepts, convert in swift!

You can add new view instead of status bar as custom status bar look

Hope this will help :)

Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75
0
int itemToHide = 0;
[[objc_getClass("SBStatusBarStateAggregator") sharedInstance]                  
beginCoalescentBlock];
[[objc_getClass("SBStatusBarStateAggregator") sharedInstance]
_setItem:itemToHide enabled:NO];
[[objc_getClass("SBStatusBarStateAggregator") sharedInstance]     
endCoalescentBlock];

please check this link. it's may help you.

Community
  • 1
  • 1
Manjeet
  • 101
  • 9