2

I got trouble put the UI image inside Grid Layout Group in Unity.

This What happen. Check the link below.

  1. [IMG] http://i65.tinypic.com/fp2dly.jpg [/IMG]

  2. [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

Dennis Liu
  • 303
  • 5
  • 21

1 Answers1

2

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

Dennis Liu
  • 303
  • 5
  • 21
  • hi Dennis, you got it ! yes that's the secret. you **cannot** set the parent in the usual way (`.parent =`) Cheers! – Fattie Jul 12 '16 at 12:29
  • Yeah @JoeBlow, i must be able to tick my answer tomorrow. THanks – Dennis Liu Jul 12 '16 at 15:22
  • HI @JoeBlow, Could you please help me with this questions ? [link](http://stackoverflow.com/questions/38691945/how-to-arrange-a-desain-gameobject-or-ui-to-become-scrollable-using-scroll-rect) – Dennis Liu Aug 01 '16 at 08:43