iOS 点击return或者点击屏幕键盘消失

 

//定义两个文本框  
UITextField *textName;  
UITextField *textSummary;  
  
//点击return 按钮 去掉  
-(BOOL)textFieldShouldReturn:(UITextField *)textField  
{  
    [textField resignFirstResponder];  
    return YES;  
}  
//点击屏幕空白处去掉键盘  
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event  
{  
    [self.textName resignFirstResponder];  
    [self.textSummary resignFirstResponder];  

 转载自:http://blog.csdn.net/zhaopenghhhhhh/article/details/12558591

 

相关文章:

  • 2021-08-14
  • 2022-12-23
  • 2021-09-01
  • 2021-07-28
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-14
  • 2021-11-04
  • 2018-12-18
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案