且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何以编程方式检查 iOS 应用程序中是否存在键盘?

更新时间:2023-11-26 11:42:10

...或采取简单的方法:

…or take the easy way:

当您输入 textField 时,它会成为第一响应者并出现键盘.您可以使用 [myTextField isFirstResponder] 检查键盘的状态.如果返回YES,则键盘处于活动状态.

When you enter a textField, it becomes first responder and the keyboard appears. You can check the status of the keyboard with [myTextField isFirstResponder]. If it returns YES, then the the keyboard is active.