Here the First image shows the normal screen.
The second screen shot shows screen position after opening the keyboard.
I am using Cocos2dx 2.2.4. and input box is implemented with CCEditBox Class.
The Strange thing is that the current code has this effect while running it through xCode6,but the same code is also on sale in AppStore.
Following code is used for implementation:
The Following code is for username field:
if (hd)
{
login_username = extension::CCEditBox::create(editBoxSize,extension::CCScale9Sprite::create(“hdeditbox.png”));
}
else
{
login_username = extension::CCEditBox::create(editBoxSize,extension::CCScale9Sprite::create(“editbox.png”));
}
login_username->setFontColor(ccBLACK);
login_username->setPlaceHolder("");
login_username->setReturnType(cocos2d::extension::kKeyboardReturnTypeDone);
login_username->setInputFlag(cocos2d::extension::kEditBoxInputFlagInitialCapsAllCharacters);
login_username->setMaxLength(8);
this->addChild(login_username);
The Following code is for password field
if (hd)
login_password = extension::CCEditBox::create(editBoxSize,extension::CCScale9Sprite::create(“hdeditbox.png”));
else
login_password = extension::CCEditBox::create(editBoxSize,extension::CCScale9Sprite::create(“editbox.png”));
login_password->setFontColor(ccBLACK);
login_password->setPlaceHolder("");
login_password->setReturnType(cocos2d::extension::kKeyboardReturnTypeDone);
login_password->setInputFlag(cocos2d::extension::kEditBoxInputFlagPassword);
login_password->setMaxLength(20);
this->addChild(login_password);