cocos2d-js学习之如何加载键盘 Life is but a span.
-
加载一个TextFieldTTF:
_textField = new cc.TextFieldTTF("<click here for input>",TEXT_INPUT_FONT_NAME,TEXT_INPUT_FONT_SIZE);
-
在touchend里调用onClickTrackNode:
onClickTrackNode(){ textField.attachWithIME();//调出键盘 //或者 textField.detachWithIME();//退出键盘 }
-
#动作或者字数限定,重载函数并且进行设定:
onTextFieldDeleteBackward(){} onTextFieldInsertText(){} onTextFieldDetachWithIME(){} onTextFieldAttachWithIME(){}
blog comments powered by Disqus