您的位置:首页 > 产品设计 > UI/UE

UIButton return(textField textView)

2013-06-18 21:38 267 查看
首先设置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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: