Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How can I use grids to merge cells?

Discussion in 'UGUI & TextMesh Pro' started by faulknordonald, Oct 30, 2023.

  1. faulknordonald

    faulknordonald

    Joined:
    Sep 9, 2019
    Posts:
    152
    So, I've tried several ways to handle this and can't get it working. I want a grid like this:

    upload_2023-10-30_13-47-22.png

    Two rows of colors and one big square at the right.

    I tried.

    Parent (Grid Layout Group - Fixed Row Count: 2)
    -- Child (Horizontal Layout Group)
    ---- Colors 1 through 5
    -- Child (Horizontal Layout Group)
    ---- Colors 6 through 10
    -- Child (Horizontal Layout Group)
    ---- Random Color

    I tried rearranging things. Just can't get it right.
     
  2. faulknordonald

    faulknordonald

    Joined:
    Sep 9, 2019
    Posts:
    152
    UPDATE: I've gotten closer:

    upload_2023-10-30_14-6-37.png

    There's still a gap between the big square and the rest.

    I used only Grid Layouts for Parent and Child. With Parent having 1 row, Child 1 has 2 rows, Child 2 has 2 rows, and Child 3 has 1 row.

    I understand why. The last child has the same width as the others. I need to figure out a way to make the last child have a different width. Probably another Grid Layout Group.
     
    Last edited: Oct 30, 2023