0

这个问题不是关于隐藏状态栏,而只是隐藏状态栏的文本

我无法在任何地方找到它来解决这个问题

UBER 应用是这样做的,当我们在 uber 中打开侧边菜单时,状态栏文字消失,

4

2 回答 2

2

不,你不能隐藏textstatus bar。您可以使用动画隐藏状态栏,例如,

  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);
}];

它在 obj c 中,只是为了理解概念,快速转换!

您可以添加新视图而不是状态栏作为自定义状态栏外观

希望这会有所帮助:)

于 2016-05-19T07:17:49.757 回答
0
int itemToHide = 0;
[[objc_getClass("SBStatusBarStateAggregator") sharedInstance]                  
beginCoalescentBlock];
[[objc_getClass("SBStatusBarStateAggregator") sharedInstance]
_setItem:itemToHide enabled:NO];
[[objc_getClass("SBStatusBarStateAggregator") sharedInstance]     
endCoalescentBlock];

请检查链接。它可能会帮助你。

于 2016-05-19T05:49:02.207 回答