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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM