mirror of https://github.com/axmolengine/axmol.git
Modify testCase for UITextFieldTest
This commit is contained in:
parent
49b39bb9c5
commit
14c1862f7e
|
@ -29,9 +29,15 @@ var UITextFieldTest = UIScene.extend({
|
|||
var widgetSize = this._widget.getContentSize();
|
||||
//init text
|
||||
this._topDisplayLabel.setString("No Event");
|
||||
this._topDisplayLabel.setAnchorPoint(cc.vertex2(0.5, -1));
|
||||
this._topDisplayLabel.setPosition(cc.vertex2(widgetSize.width / 2.0, widgetSize.height / 2.0 + this._topDisplayLabel.getContentSize().height * 1.5));
|
||||
|
||||
this._bottomDisplayLabel.setString("TextField");
|
||||
this._bottomDisplayLabel.setPosition(cc.vertex2(widgetSize.width / 2.0, widgetSize.height / 2.0 - this._bottomDisplayLabel.getContentSize().height * 3.4));
|
||||
this._bottomDisplayLabel.setColor(cc.color(255, 255, 255, 255));
|
||||
|
||||
// Create the textfield
|
||||
cc.director.getOpenGLView().setIMEKeyboardState(true);
|
||||
var textField = new ccui.TextField("PlaceHolder", "Marker Felt", 30);
|
||||
textField.x = widgetSize.width / 2.0;
|
||||
textField.y = widgetSize.height / 2.0;
|
||||
|
@ -48,7 +54,7 @@ var UITextFieldTest = UIScene.extend({
|
|||
case ccui.TextField.EVENT_ATTACH_WITH_IME:
|
||||
var widgetSize = this._widget.getContentSize();
|
||||
textField.runAction(cc.moveTo(0.225,
|
||||
cc.p(widgetSize.width / 2, widgetSize.height / 2 + textField.height / 2)));
|
||||
cc.p(widgetSize.width / 2, widgetSize.height / 2 + 30)));
|
||||
this._topDisplayLabel.setString("attach with IME");
|
||||
break;
|
||||
case ccui.TextField.EVENT_DETACH_WITH_IME:
|
||||
|
@ -65,7 +71,6 @@ var UITextFieldTest = UIScene.extend({
|
|||
default:
|
||||
break;
|
||||
}
|
||||
this._bottomDisplayLabel.setString(textField.getString());
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue