- Home /
Question by
fabioColombini · Jun 01, 2018 at 11:27 PM ·
scrollviewlayout
Scrollview itens aligned like whatsapp
Is there a way to put each item inside the Content of Scrollview aligned in different position (left/right)? Like whatsapp message: from one person aligned to the right, mine to the left.
Comment
Best Answer
Answer by b1gry4n · Jun 02, 2018 at 12:46 AM
use https://docs.unity3d.com/Manual/script-GridLayoutGroup.html
there would be 2 types of messages. sent and received. just make the layout of a send message align with the right and the received align left. Those could even be 2 different gameobjects youre instantiating where you have sent with a different color than received. After you instantiate it you make it a child of the gridlayoutgroup