CocosCreator3.x开发笔记5: Label自动计算宽
作者:
原味蛋炒饭 | 来源:发表于
2023-02-07 11:57 被阅读0次lab.string = strategy[0].about
//updateRenderData要在lab设置好所有参数后,再调用,计算大小
lab.updateRenderData(true);
let labUiT = lab.getComponent("cc.UITransform") as UITransform
let contentV = this.node.getChildByPath("ContentBg/ScrollView/view/content")
let contUiT = contentV.getComponent("cc.UITransform") as UITransform
contUiT.contentSize = new Size(contUiT.contentSize.width, labUiT.contentSize.height)
本文标题:CocosCreator3.x开发笔记5: Label自动计算宽
本文链接:https://www.haomeiwen.com/subject/qznxkdtx.html
网友评论