更换UITextView的换行键为完成键
2016-03-03 10:09
489 查看
更换UITextView的换行键为完成键
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ // Any new character added is passed in as the "text" parameter if ([text isEqualToString:@"\n"]) { // Be sure to test for equality using the "isEqualToString" message [textView resignFirstResponder]; // Return FALSE so that the final '\n' character doesn't get added return FALSE; } // For any other character return TRUE so that the text gets added to the view return TRUE;}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ // Any new character added is passed in as the "text" parameter if ([text isEqualToString:@"\n"]) { // Be sure to test for equality using the "isEqualToString" message [textView resignFirstResponder]; // Return FALSE so that the final '\n' character doesn't get added return FALSE; } // For any other character return TRUE so that the text gets added to the view return TRUE;}
相关文章推荐
- PHP中return 和 exit 、break和contiue 区别与用法
- 浅析return false的正确使用
- javascript中return,return true,return false三者的用法及区别
- 学习jQuey中的return false
- Firefox下提示illegal character并出现乱码的原因
- js怎么终止程序return不行换jfslk
- 解析php中die(),exit(),return的区别
- Javascript中的return作用及javascript return关键字用法详解
- c语言中return与exit的区别浅析
- C++流程控制中用于跳转的return和goto语句学习教程
- Ruby中的return、break、next详解
- 浅析echo(),print(),print_r(),return之间的区别
- PHP return语句另类用法不止是在函数中
- PowerShell中使用return语句退出函数例子
- javascript中的return和闭包函数浅析
- exit(-1)或者return(-1)shell得到的退出码为什么是255
- return false;和e.preventDefault();的区别
- JavaScript中return false的用法
- php中return的用法实例分析
- 浅析javascript的return语句