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.
问题是光标在一个文本字段上。我想按栏按钮隐藏键盘。此条形按钮使用 IB 创建并连接一个 IBAction。
-(IBAction)BarButtonMethod { [yourTextFieldObject resignFirstResponder]; }
就这样做,让你 o/p
使用 [YourView endEditing:YES];
这将导致您视图中的任何文本字段退出第一响应者状态