Commit 3755b1c8 authored by 李维's avatar 李维

添加动态配置输入框行数代码

暂时注释-方案还不完善
parent 0169d504
...@@ -164,6 +164,23 @@ export default class NewClass extends cc.Component { ...@@ -164,6 +164,23 @@ export default class NewClass extends cc.Component {
this.isShow = true; this.isShow = true;
// 获取Editbox组件 // 获取Editbox组件
const editBox = cc.find("textEditBox", this.editBoxContainer).getComponent(cc.EditBox); const editBox = cc.find("textEditBox", this.editBoxContainer).getComponent(cc.EditBox);
// 动态配置输入框行数代码
// const textEditBox = cc.find("textEditBox", this.editBoxContainer);
// // 获取Editbox组件
// const editBox = textEditBox.getComponent(cc.EditBox);
// const componentTextLabel = cc.find("TEXT_LABEL", textEditBox).getComponent(cc.Label);
// const PLACEHOLDER_LABEL = cc.find("PLACEHOLDER_LABEL", textEditBox).getComponent(cc.Label);
// const multipleLines = lineNum > 1 ? true : false; // 多行模式
// editBox.inputMode = multipleLines ? 0 : 6;
// cc.find("TEXT_LABEL", textEditBox).active = true;
// componentTextLabel.horizontalAlign = multipleLines ? 0 : 1;
// componentTextLabel.verticalAlign = multipleLines ? 0 : 1;
// componentTextLabel.enableWrapText = multipleLines ? true : false;
// PLACEHOLDER_LABEL.horizontalAlign = multipleLines ? 0 : 1;
// PLACEHOLDER_LABEL.verticalAlign = multipleLines ? 0 : 1;
// PLACEHOLDER_LABEL.enableWrapText = multipleLines ? true : false;
// textEditBox.height = lineNum * 80;
// 设置默认显示文字 // 设置默认显示文字
editBox.string = defaultText; editBox.string = defaultText;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment