iOS 3.2 上弹出窗口关闭时键盘不会消失

发布于 2024-09-15 10:33:51 字数 592 浏览 4 评论 0原文

- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController {
    [self dismissFirstResponder];
    return YES;
}


-(void)dismissFirstResponder {
    [nameField resignFirstResponder];
    [descriptionField resignFirstResponder];
    [helpField resignFirstResponder];
 }

我已经尝试了很多不同的事情,但键盘就是没有按下去:

  1. 我检查了我的插座是否在 Interface Builder 中正确连接,
  2. 我在 2 个方法中放置了断点,以检查它们是否在适当的时间被调用,他们确实是。这 3 个文本字段是应用程序中唯一的文本字段。

会发生什么:弹出窗口被关闭,但键盘保持打开状态。

我真的很感激在这个问题上的一些帮助。这可能是 iOS 3.2 上的一个已知错误,如果是这样,我们将非常感激地接受任何解决方法。谢谢

- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController {
    [self dismissFirstResponder];
    return YES;
}


-(void)dismissFirstResponder {
    [nameField resignFirstResponder];
    [descriptionField resignFirstResponder];
    [helpField resignFirstResponder];
 }

I have tried loads of different things, but the keyboard just isn't going down:

  1. I checked to see if my outlets were hooked up correctly in Interface Builder
  2. I put breakpoints inside the 2 methods to check they were being called at the appropriate times, and they were. Those 3 Text Fields are the only ones in the app.

What happens: The popover gets dismissed but the keyboard stays up.

I would really appreciate some help on this matter. It might be a known bug on iOS 3.2, if so any workarounds would be gratefully accepted. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱的那么颓废 2024-09-22 10:33:51

确保为 UITextView 和 UITextField 分配了委托

然后调用以下方法从视图中消除任何键盘活动。

[self.view endEditing:YES];

Make sure the delegate for UITextView the UITextField is assigned

Then call the following method to dismiss any keyboard activity from the view.

[self.view endEditing:YES];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文