UIButton return(textField textView)

首先设置TextField 或 TextView的 delegate
/////UITextView
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
if ([text isEqualToString:@"\n"]) { NSLog("点击return");
return NO;
}
return YES;
}
/////UITextField
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
NSLog("点击return");
return YES;
}
上一篇:Linux架构之Rsync守护进程推和拉


下一篇:eclipse工程加入jquery.min.js报错:missing semicolon