简体   繁体   English

键盘未出现在UINavigationController的UIWebView中

[英]Keyboard does not appear in the UIWebView on the UINavigationController

I have a UIWebView in UINavigationController. 我在UINavigationController中有一个UIWebView。 I have a TableView, When the clicks cell of the table, it goes to WebView, but when user clicks textfield in webview, keyboard will does not show up. 我有一个TableView,当单击表的单元格时,它将转到WebView,但是当用户单击Webview中的文本字段时,键盘将不会显示。 Why does not show up? 为什么不显示? Which part of code is required? 哪一部分代码是必需的?

This code is part of the transition to UIWebView below. 此代码是下面过渡到UIWebView的一部分。

    UIViewController *wvc = [[UIViewController alloc] init];

    UIWebView *uiWebView = [[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)];
    [uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://sample/form.html"]]];

    [wvc.view addSubview: uiWebView];

    [self.navigationController pushViewController:wvc animated:YES];

Any help is greatly appreciated. 任何帮助是极大的赞赏。

This happens when the window containing the web view isn't the key window. 当包含Web视图的窗口不是关键窗口时,就会发生这种情况。 This can happen if you create more than one UIWindow in your app and forget to return the key window status to your main window. 如果您在应用中创建了多个UIWindow ,却忘记将关键窗口状态返回到主窗口,则会发生这种情况。 Sending -makeKeyWindow or -makeKeyAndVisible to your main window (the one in your MainWindow nib or created by your app delegate) fixes this. -makeKeyWindow-makeKeyAndVisible发送到主窗口(MainWindow笔尖中的一个或由应用程序委托创建的)可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM