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