您的位置:首页 > 移动开发 > IOS开发

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

2013-10-10 10:22 375 查看


[cpp] view
plaincopy

//定义两个文本框

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];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐