- //定义两个文本框
- 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];
- }
IOS成长之路-去掉屏幕键盘的方法
时间: 2024-10-09 21:18:39