mirror of https://github.com/axmolengine/axmol.git
close keyboard when Done is pressed (#20341)
* close keyboard when Done is pressed
This commit is contained in:
parent
238cd782e3
commit
1934eb5ac9
|
@ -389,6 +389,12 @@
|
|||
|
||||
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
|
||||
{
|
||||
if ( self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::DONE &&
|
||||
[text isEqualToString: @"\n"] )
|
||||
{
|
||||
[self closeKeyboard];
|
||||
}
|
||||
|
||||
int maxLength = getEditBoxImplIOS()->getMaxLength();
|
||||
if (maxLength < 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue