Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

uGUI: If I make a list view, HolizontalLayout should not be used?

Discussion in 'UGUI & TextMesh Pro' started by madnesslabo, Sep 2, 2014.

  1. madnesslabo

    madnesslabo

    Joined:
    Nov 8, 2012
    Posts:
    59
    If I am trying to line them up, starting vertically, horizontally, or simply without changing the size of each object, should not use the AutoLayot or probably good.
    For example, if I am trying to make a list view which items are arranged in vertical such as Twitter, the size of each item will change With HolizontalLayout.
    Should not be used for such purposes these or probably good AutoLayot?
    Or would I solve if you use LayoutElement and ContensSizeFilter?
    I am hard to know what is for what purpose and AutoLayot, combination ContensSizeFilter, of LayoutElement.
     
  2. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    Using LayoutElement and ContentSizeFitter will work: In LayoutElement, put in your preferred size (defaults to the current size of the item) and set ContentSizeFitter to preferred. It will give you a "warning" that you shouldn't combine ContentSizeFitter and LayoutGroup elements, but you can ignore it.

    CSF+LE will lock the size of an item, so the Layout Group will just position it without stretching it.
     
  3. madnesslabo

    madnesslabo

    Joined:
    Nov 8, 2012
    Posts:
    59
    Thank you.
    We can continue to have a fixed size.
    But, in order to adjust the position of the child object, issues such as where there is a need to change the size of the better of HolizontalLayoutGroup is likely.

    If I make a list view, seems to be better without having to use the AuotLayut, made a homebrew class that only the position adjustment of the child objects simply. For example HolizontalAlignmentGroup.

    Please let me know if there is an opinion this is not good in design of uGUI.