diff --git a/cocos2d/core/editbox/CCSGEditBox.js b/cocos2d/core/editbox/CCSGEditBox.js index 94c1acbbdb..8e640f9374 100644 --- a/cocos2d/core/editbox/CCSGEditBox.js +++ b/cocos2d/core/editbox/CCSGEditBox.js @@ -250,9 +250,8 @@ EditBoxImpl.prototype = { }, _updateLabelPosition: function (editBoxSize) { - var textLabelSize = this._textLabel.getContentSize(); - this._placeholderLabel.setLineHeight(editBoxSize.height); this._textLabel.setContentSize(editBoxSize); + this._placeholderLabel.setLineHeight(editBoxSize.height); var placeholderLabelSize = this._placeholderLabel.getContentSize(); if (this._editBox._editBoxInputMode === InputMode.ANY){ @@ -264,7 +263,7 @@ EditBoxImpl.prototype = { } else { this._textLabel.enableWrapText(false); - this._textLabel.setPosition(cc.p(0, (editBoxSize.height + textLabelSize.height) / 2)); + this._textLabel.setPosition(cc.p(0, editBoxSize.height)); this._placeholderLabel.setPosition(cc.p(0, (editBoxSize.height + placeholderLabelSize.height) / 2)); this._placeholderLabel.setVerticalAlign(cc.VerticalTextAlignment.CENTER); this._textLabel.setVerticalAlign(cc.VerticalTextAlignment.CENTER);