Created
February 23, 2012 04:21
-
-
Save blankyao/1890139 to your computer and use it in GitHub Desktop.
在UITextView里面响应return键
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma - | |
#pragma UITextViewDelegate | |
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text | |
{ | |
if (range.length != 1 && [text isEqualToString:@"\n"]) {//按下return键 | |
//TODO 做你想做的 | |
return NO; | |
} else { | |
return YES; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for your method