我创建了一个加载UIWindow,当我开始加载时,我调用它并使用
makeKeyAndVisible
。完成后,我将我的主UIWindow设置为makeKeyAndVisible
。但我的问题是在这样做之后,当我点击文本框时,键盘不会弹出。这个问题在Cursor is blinking in UITextField but keyboard doesn't appear中提到,但我找不到正确的答案。
编辑:在UIView中,当我点击地址栏时,键盘确实会弹出,但我无法输入。但在谷歌页面中,当我点击搜索文本框时,键盘不会弹出。
- (void)showLoading:(NSString*)text
{
loadingWindow = [[UIWindow alloc] init];
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];
mainWindow = UIApplication.sharedApplication.keyWindow;
[loadingWindow setFrame:CGRectMake(0, 0, boundWidth, boundHeight)];
[loadingWindow setRootViewController:[[UIViewController alloc] init]];
[loadingWindow.rootViewController setView:[[UIView alloc] init]];
[loadingWindow.rootViewController.view setFrame:loadingWindow.frame];
[loadingWindow setHidden:NO];
}
- (void)hideLoading
{
[loadingWindow setHidden:YES];
[loadingWindow removeFromSuperview];
}