我正在搜索如何轻松禁用从游戏中滑出控制中心和通知中心的功能,在玩游戏时很烦人,不幸的是跳转到通知中心。
有什么想法吗?
答案 0 :(得分:0)
您只需要隐藏状态栏:
<强> 1。对于某个视图控制器:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
}
- (void)viewWillDisappear:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
[super viewWillDisappear:animated];
}
<强> 2。整个申请:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
}