Update CCEditBoxImplIOS.mm

02c6647306
This commit is contained in:
sunxiaoyu 2013-05-24 18:10:04 +08:00 committed by James Chen
parent d421c262ef
commit d41a78453a
1 changed files with 3 additions and 2 deletions

View File

@ -81,8 +81,7 @@ static const int CC_EDIT_BOX_PADDING = 5;
[textField_ addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged];
self.editBox = editBox;
[[EAGLView sharedEGLView] addSubview:textField_];
textField_.hidden = YES;
return self;
}while(0);
@ -117,12 +116,14 @@ static const int CC_EDIT_BOX_PADDING = 5;
-(void) openKeyboard
{
[[EAGLView sharedEGLView] addSubview:textField_];
[textField_ becomeFirstResponder];
}
-(void) closeKeyboard
{
[textField_ resignFirstResponder];
[textField_ removeFromSuperview];
}
- (BOOL)textFieldShouldReturn:(UITextField *)sender