在iOS9.1中,当我通过UIWindow删除自定义removeFromSuperView并将其设置为零时,它不会自动消失,直到单击窗口。并显示错误
_UIApplicationHandleEventFromQueueEvent中的意外零窗口,_windowServerHitTestWindow:(null)
当在iOS9和更低的时候,它会工作的很好。
UIWindow *window = [target associatedValueForKey:lock_window];
if (window) [window removeFromSuperview];
[target associateValue:nil withKey:lock_window];发布于 2015-11-06 09:44:11
我用代码解决了这个问题。
UIWindow *window = [target associatedValueForKey:lock_window];
if (window) [window removeFromSuperview];
window.hidden = YES;
[target associateValue:nil withKey:lock_window];- (void)makeKeyAndVisible方法注释是
方便。大多数应用程序称之为这是为了显示主窗口,并使它的关键。否则使用视图隐藏属性
https://stackoverflow.com/questions/33563339
复制相似问题