鍵盤取消第一響應的幾種方式(隱藏鍵盤)

  • 傳送門
  • 很多的時候,我們需要取消鍵盤,但是又不知道鍵盤的第一響應者,那么怎么辦呢,那么可以通過一下方法解決:
[[UIApplicationsharedApplication] sendAction:@selector(resignFirstResponder)to:nil from:nil forEvent:nil];

官方文檔有說明:
The object to receive the action message. If target is nil, the app sends the message to the first responder, from whence it progresses up the responder chain until it is handled.

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容