Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在有UIAlertView弹出后,keyWindow会被替换为emptyWindow #24

Open
tongxyj opened this issue Oct 5, 2018 · 3 comments
Open

在有UIAlertView弹出后,keyWindow会被替换为emptyWindow #24

tongxyj opened this issue Oct 5, 2018 · 3 comments
Labels

Comments

@tongxyj
Copy link

tongxyj commented Oct 5, 2018

在有UIAlertView弹出后,因为UIEmptywindow的alertLevel为2000,keyWindow会被替换为emptyWindow,这会导致项目中有[UIApplication sharedApplication].keywindow addsubView:xxView];的控件被添加到emptyWindow上,以至于这些控件无法交换和销毁。

@pikacode pikacode added the bug? label Oct 15, 2018
@pikacode
Copy link
Owner

我按你说的操作没有出现这个问题。另外,在这个控件初始化的时候,会通过 makeKeyAndVisible 的方式添加到 app 的 windows 里,然后又将原先 window 重新置为 key,如果在这中间进行 keywindow addsubView,就会导致你说的问题。

@pikacode
Copy link
Owner

@zhaitong 可以在appdelegate头文件中将初始化的 window 属性抛出,需要使用的地方直接使用

@tongxyj
Copy link
Author

tongxyj commented Jan 18, 2019

@zhaitong 可以在appdelegate头文件中将初始化的 window 属性抛出,需要使用的地方直接使用

用delegate.window是没有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants