问题
I got trouble put the UI image inside Grid Layout Group in Unity.
This What happen. Check the link below.
[IMG] http://i65.tinypic.com/fp2dly.jpg [/IMG]
[IMG] http://i65.tinypic.com/2iudlxe.jpg [/IMG]
Whatever i have done change the Grid Layout Group Component : cell size value, spacing. It end with the same result like the url pic above with image gameobject cut at left side. The image gameobject size did not fix the content from the grid layout group.
When i try to scroll it, it end with same result.
Any idea ?
Thanks
回答1:
I found the solution myself,
Read this :
http://docs.unity3d.com/ScriptReference/Transform.SetParent.html
example :
childx.transform.SetParent (parentx.gameObject.transform,false);
it solve the problem
来源:https://stackoverflow.com/questions/38313413/put-ui-image-to-grid-layout-group-unity-c-sharp