我试图保持子元素的纵横比内水平布局集团当孩子的总宽度将超过布局集团的宽度。
给定下面的“水平布局组”,子正方形的总宽度适合于父正方形,因此无需缩放:
如果我们添加更多子项,并且它们的总宽度超过了布局组的宽度,但是默认情况下,它们不会相应缩放:
理想的结果是,它们将按比例缩放以适合布局组的宽度:
I have tried various configurations of settings on the Layout Group's properties and just cannot produce the desired outcome.
The closest I can get the below by checking Control Child Size: Width
and setting a Layout Element component on the child and setting the preferred width and height.
Control Child Size: Whether the Layout Group controls the width and height of its child layout elements.
Use Child Scale: Whether the Layout Group considers the scale of its child layout elements when sizing and laying out elements. Width and Height correspond to the Scale > X and Scale > Y values in each child layout element’s Rect Transform component.
Child Force Expand: Whether to force the child layout elements to expand to fill additional available space.
My brain is just not getting to the correct config.
希望我能忽略一些简单的事情。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句