Search Unity

Unity UI Layout group and anchors

Discussion in 'UGUI & TextMesh Pro' started by AcademyOfFetishes, Jan 5, 2019.

  1. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    Hello,

    I'm using layout groups nested in other layout groups to design a UI. It looks fine on my resolution, but if I change the aspect ratios, everything looks out of wack:

    How I develop: https://imgur.com/a/ASM71x7

    5:4 ratio: https://imgur.com/a/grZw829

    The way I fixed this on different UI elements is to drag the anchors to the 4 corners of the current element. But because I'm using Vertical/Horizontal layout groups, it doesn't let me manually change the anchors of the children. It seems like I can get a version of the preset anchor positions by changing this dropdown:


    But I can't achieve the same thing as "put the anchors at the 4 corners of the child" from that dropdown. As a result, I can't get any of the UI to look good on any ratio but the one I develop on.

    How do I get the best of both worlds: Layout groups but custom child anchor positions?

    If it's not possible, then how can Layout groups be useful? Seems like they could only look correct in one resolution.
     
    ZenUnity likes this.
  2. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    gring0ar likes this.