ios - _UIApplicationHandleEventFromQueueEvent、_windowServerHitTestWindow 中出现意外的零窗口

标签 ios objective-c ipad ios8 uipangesturerecognizer

我正在尝试在 iPad 上的 iOS 8 中设置边缘滑动手势,但出现错误,这似乎是一个错误。

我有以下代码:

    UIScreenEdgePanGestureRecognizer *edgeRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleRightEdgeSwipe:)];
edgeRecognizer.edges = UIRectEdgeRight;
[self.view addGestureRecognizer:edgeRecognizer];

然后我处理手势:

-(void)handleRightEdgeSwipe:(UIGestureRecognizer*)sender
{
//slide in view code here
}

问题是它不会每次都检测到右边缘滑动。有时它会多次检测到它。

无论是否检测到,在 iPad 上向右滑动时总是在控制台显示以下信息:

2014-10-07 00:04:40.386 Office Log[1531:500896] unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: ; layer = >

此消息是什么意思,我该如何解决它以便始终检测到右边缘滑动?

最佳答案

我认为这是 iOS 中的一个错误,我可以在 iOS 7 或更高版本的 iPad mini 2 和 iPad Air 上确认,甚至在主屏幕上也是如此。

在“横向左侧”(左侧的主页按钮)中,屏幕外的“右边缘手势”对我不起作用。在主屏幕上自行测试。

我在 9 个月前向 Apple 报告了一个错误,但注意到发生了进一步的错误。

更新:

我玩了一下 UIWindow init,当它比实际大一点时,Gesture 起作用了。当然,这是一个可怕的修复。

self.window = [UIWindow new];
self.window.rootViewController = [[UIViewController alloc] init];

// Real Size
CGRect frame = [UIScreen mainScreen].bounds;

// Real Size + 0.000001
self.window.frame = CGRectMake(0, 0, frame.size.width+0.000001, frame.size.height+0.000001);
[self.window makeKeyAndVisible];

关于ios - _UIApplicationHandleEventFromQueueEvent、_windowServerHitTestWindow 中出现意外的零窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26226259/

相关文章:

iphone - 如何在 iPhone 中不使用 UIPIckerviewcontroller 创建下拉列表?

ios - 使用 Storyboard发送到实例的无法识别的选择器

ios - 如何快速创建单例对象

iphone - 触摸时触感更大

objective-c - 从另一个类引用静态 NSString * const

objective-c - 将 NSTableView 和 NSArrayController 绑定(bind)在一起

IOS 9 Ipad kCFStreamErrorDomainSSL, -9802,如何解决这个问题?

iphone - 在我的 UITableView 中滚动时,返回时隐藏的行很奇怪

ios - dispatch_async(dispatch_get_main_queue() 不适用于 iPad,但适用于 iPhone

ios - 同时使用 Fabric 和 Firebase Crashlytics