Layout Update

    Layout Update

    Layout Update

    위와 같은 구조에서 Layout 노드에 아이템을 추가/삭제할 때마다 Layout 노드의 사이즈도 유동적으로 변한다. 아이템 간의 padding(간격)과 레이아웃에 속해 있는 아이템들의 넓이들을 모두 더한 값을 자동으로 계산한다. 그러나 스크립트에서 아이템을 추가했을 때는 자동으로 계산이 되지 않는다. let width1 = this.testLayout.node.width; // 391.48 let newLabel = cc.instantiate(this.testLayout.node.children[0]); newLabel.setParent(this.testLayout.node); let width2 = this.testLayout.node.width; // 391.48 실제로 위의 코드를 디버깅해보면 레이..