Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Toggles in a Vertical Layout Group

Discussion in 'UGUI & TextMesh Pro' started by MythicalCity, Oct 12, 2014.

  1. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    418
    4.6b20

    Adding a toggle into a vertical layout group with other elements like Buttons doesn't seem to position the toggle the same way as the buttons with the same amount of space between them. Maybe this is because the toggle doesn't have an image component on the same gameobject as the toggle?
     
  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,613
    Sounds plausible. Have you tried attaching a Layout Element to all the buttons/toggles, and overriding the size values with it?
     
  3. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    418
    I tried that but maybe I'm just not using these the right way. Here's what mine looks like: http://cl.ly/image/2K0S3Q47191R

    The toggle is centered on the top edge of the layout group instead of inside it. The image (checkbox) is anchored to the top so it shouldn't be centered like that.
     
  4. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,870
    What did you set the Min Height on the Layout Element on the Toggle to? With a proper value set, it shouldn't look like that...
     
    strongBearCeo likes this.
  5. strongBearCeo

    strongBearCeo

    Joined:
    May 2, 2016
    Posts:
    5
    Got the same problem. Adding a Layout Element and setting the Min Height solved it. Thanks!