Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 iPhone 的初学者,我在 textview 上工作,当时单击键盘上的单击返回按钮的输入键时键盘不会关闭,但输入键出现在下一行。但是当我写一些东西并输入键并且该键盘直接关闭时,我有要求,所以请提供任何建议和源代码。
在 TextView Delegate 中使用它-
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if([text isEqualToString:@"\n"]) { [textView resignFirstResponder]; return NO; } return YES; }