简单的方法来关闭键盘? [英] Easy way to dismiss keyboard?

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

问题描述

我有很多控制分散在我的表格中的许多表格单元格,我想知道是否有一个更简单的方法来关闭键盘,而不必循环通过我的所有控制和辞职全部作为第一响应者。

I have quite a few controls scattered throughout many table cells in my table, and I was wondering if there's an easier way to dismiss the keyboard without having to loop through all my controls and resigning them all as the first responder. I guess the question is.. How would I get the current first responder to the keyboard?

推荐答案

请尝试:

[self.view endEditing:YES];

这篇关于简单的方法来关闭键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆