如何关闭 iOS 键盘?

How do I dismiss the iOS keyboard?(如何关闭 iOS 键盘?)

本文介绍了如何关闭 iOS 键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UITextfield,我想关闭它的键盘.无论我使用什么代码,我似乎都无法让键盘消失.

I have a UITextfield that i'd like to dismiss the keyboard for. I can't seem to make the keyboard go away no matter what code i use.

推荐答案

[myTextField resignFirstResponder]

这里,显示和隐藏键盘部分的第二段.

Here, second paragraph in the Showing and Hiding the Keyboard section.

这篇关于如何关闭 iOS 键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何关闭 iOS 键盘?

基础教程推荐