在用到文本框的时候,会用到keyboard。但是我们发现它没有done键(在我们输入完成后不能退出。),解决方法为object注册 resignFirstResponder。

1 -(IBAction)hideKeyboard:(id)sender{
2 
3   [object resignFirstResponder];
4 
5 }

 

另外,如果用numberPad(数字键盘的话)会没有return键。

可以在View后加一个覆盖全窗口的button,连接到hideKeyboard事件,这样当点击窗口空白区就可以实现退出触摸键盘。

相关文章:

  • 2021-11-22
  • 2021-09-19
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2021-10-07
  • 2021-07-13
  • 2021-09-18
  • 2021-05-18
  • 2022-12-23
  • 2021-12-04
  • 2021-08-12
相关资源
相似解决方案