Make iPhone status bar disappear when displaying a modal view?

前端 未结 2 1727
轮回少年
轮回少年 2021-01-12 19:59

I want to display a modal view, and want it to cover the iPhone\'s status bar.

I tried setting the modal view controller\'s wantsFullScreenLayout property to YES; I

2条回答
  •  灰色年华
    2021-01-12 20:34

    You'll be wanting the - (void)setStatusBarHidden:(BOOL)hidden animated:(BOOL)animated on the UIApplication class.

    Something like this:

    [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
    

    That should hide the status bar with a nice fade animation.

提交回复
热议问题