mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
fix editbox text vertical alignment
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user