From d41a78453a5fa2aa1714e8407dc5f85c30aafe4f Mon Sep 17 00:00:00 2001 From: sunxiaoyu <84136264@qq.com> Date: Fri, 24 May 2013 18:10:04 +0800 Subject: [PATCH] Update CCEditBoxImplIOS.mm https://github.com/sunxiaoyu/cocos2d-x/commit/02c664730669c7e3d5d0ecc727deab9aa785c2c7 --- extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm index f7ddc3e7d4..a36af69be7 100755 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm @@ -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