admin管理员组文章数量:1122832
I use Unity3D viewport
Inside the viewport
content
- button_1
-transform_1
Button_2
tranform_2
Button_3
. . .
It's arranged like this
When each button is clicked, an input field is created to enter a specific value in the transform position
The generated input field has a + button, which creates an input field when the + button is pressed, and I want to make the button_2 or button_3 naturally push down as much as the newly created input field space!
button_1
Input Field_1
Input Field_2
Input Field _3
-Button_2
I want this way, but if I press the + button in the input field_1, there is a problem that occurs in the space between button_1 and button_2, and button_2 is not pushed down, but I have no idea how to solve it, so I leave a message
public void AddSizeInputField()
{
GameObject newSizeInput = Instantiate(sizeInputPrefab, sizeInputContainer);
// LayoutRebuilder.ForceRebuildLayoutImmediate(sizeInputContainer.GetComponent<RectTransform>());
InputField[] inputs = newSizeInput.GetComponentsInChildren<InputField>();
Button addButton = newSizeInput.GetComponentInChildren<Button>();
addButton.onClick.AddListener(AddSizeInputField);
inputs[0].onEndEdit.AddListener(delegate { SaveSize(inputs); });
inputs[1].onEndEdit.AddListener(delegate { SaveSize(inputs); });
SaveSize(inputs);
}
my code
本文标签: cUnity vertical layout group QuesitionStack Overflow
版权声明:本文标题:c# - Unity vertical layout group Quesition - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283874a1927112.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论