EditBox and TextField strange behavior

EditBox and TextField strange behavior
0

#1

I need to create simple sign in scene. At first i used EditBox. Everything good except password field. When I type characters are entered in the small size, but when I finish typing the size changes (look first video). This issue appears on Android and macOS but not on iOS.
Then i decided use TextField class. But i need align text to left. I set _passwordTextField->setTextHorizontalAlignment(TextHAlignment::LEFT);
but no effect (look second video).

cocos2d-x v3.17

Used system font “Helvetica” with size 32.


#2

hi can you please help me with edit box in Cocos2dx, I have set placeholder , when i click on editbox , text jumps up in editbox and when i click out side of editbox it gets back down, so how can i stop that. thanks in advance


#3

EditBox too complicated and i decide not use it. Better use TextField. I solve problem with text alignment, just need set label dimensions like that:
((Label*)textField->getVirtualRenderer())->setDimensions(textField->getContentSize().width, 0.0f);


#4

thanks for helping me out :slight_smile: I have to try edit box, if i won’t found solution for it, I am definitely gonna use this one


#5

@slackmoehrle @smitpatel88 hi… I am using it but now I am fetching another problem with it, if i am keep typing it automatically goes to another line and keep showing two line, how can i have only one line textfield, Hope you can help me out ? thanks in advance :slight_smile: