Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的实际UITextField控制嵌入在外部库中的许多层。因此我无法通过调用来检测它是否正在被编辑
UITextField
control isFirstResponder.
control isFirstResponder
是否有另一种方法来检测是否显示软件键盘?
是的,尝试为诸如“UIKeyboardWillShowNotification”之类的通知设置监听器。在通知的用户信息中,您可以获得键盘的边界,从而确定它是否可见(在屏幕上)。查看 UIWindow.h。