你如何防止游戏中的通知中心? [英] How do you prevent Notification Center in games?

查看:139
本文介绍了你如何防止游戏中的通知中心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS7中,从屏幕底部向上滑动或从屏幕顶部向下滑动,在您正在使用的应用程序顶部滑动玻璃屏幕。在许多游戏中,它非常令人沮丧。

In iOS7, swiping up from the bottom of the screen or down from the top of the screen slides a "glass screen" on top of the app you are using. In many games, it is very frustrating.

作为用户,您可以在应用中关闭此行为,但这是系统范围内的更改。

As a user, you can turn off this behavior in apps, but this is a system-wide change.

当检测到顶部/底部滑动时,愤怒的小鸟会弹出小三角形,这不是一个完美的修复,但已经存在。

Angry Birds has small triangles pop up when a top/bottom swipe is detected, which is not a perfect fix, but something already.

有没有更好的解决方案?使用什么API /调用?

Is there any better solution? What API/call to use?

推荐答案

我在Info.plist中设置statusBar最初隐藏为YES,但是失败了实现我想要的结果。 将UIApplication statusBarHidden设置为YES在iOS中不起作用7 得到了我需要的答案:

I've set statusBar is initially hidden to YES in Info.plist , but it failed to achieve the result I wanted. Setting UIApplication statusBarHidden to YES does not work in iOS 7 got me the answer I needed:

- (void)viewDidLoad 
{
 [super viewDidLoad];

if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
{
    [self prefersStatusBarHidden];
    [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
else
{
      // iOS 6
      [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
}

- (BOOL)prefersStatusBarHidden {
  return YES;
}

按照2013年10月21日的规定,这可以正常工作。

This, as per 21/10/2013, works fine.

这篇关于你如何防止游戏中的通知中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆