官术网_书友最值得收藏!

Cell Size

Unlike the Horizontal and Vertical Layout Groups, which determine the size of the children either by their Rect Transform component or by scaling them to fit inside the parent's Rect Transform, the Grid Layout Group requires you to specify the width and height of the child objects. You accomplish this by setting the X and Y properties of the Cell Size property. This will automatically apply the specified X and Y sizes to each of the children's Width and Height property of their Rect Transform, respectively.

Due to the Cell Size property and the lack of a Control Child size property, the children are not guaranteed to fit within the parent's Rect Transform. If too many children exist, it is possible they will be drawn outside the parent's Rect Transform. So, if you have a grid filling up dynamically that can change throughout the gameplay and want the grid to always fit within a specific area, you will have to prepare for that scenario of overflow.

The Grid Layout Group allows you to specify both an X and Y Spacing. The X Spacing is the horizontal spacing, and the Y Spacing is the vertical spacing. These values will not be overridden by further property choices, as they can be with the Horizontal and Vertical Layout Groups.

主站蜘蛛池模板: 广元市| 枞阳县| 雷州市| 景洪市| 叙永县| 金乡县| 滁州市| 中方县| 阳高县| 平泉县| 温泉县| 万宁市| 新建县| 沿河| 太康县| 宜良县| 平南县| 清徐县| 东丰县| 广饶县| 崇信县| 图们市| 南召县| 遵义县| 延安市| 平和县| 麻城市| 陆川县| 上林县| 西乡县| 隆化县| 文水县| 大兴区| 察哈| 诸暨市| 临猗县| 乌兰县| 忻城县| 射阳县| 山东省| 万荣县|