标签:
实现委托UITextFieldDelegate, UITextViewDelegate里以下方法
#pragma mark 放弃“第一响应者”
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[textField resignFirstResponder];
return YES;
}
-(BOOL)textView:(UITextView *) textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
if([text isEqualToString:@"\n"]){
[textView resignFirstResponder];
return NO;
}
return YES;
}
标签:
原文地址:http://www.cnblogs.com/cbyniypeu/p/4382034.html