Search Unity

Question ListView Horizontal Arrangements of Items

Discussion in 'UI Toolkit' started by costeab, Jun 10, 2020.

  1. costeab

    costeab

    Joined:
    Apr 20, 2020
    Posts:
    10
    Hi all,

    I'm trying to use a ListView as a prefab selection tool. I would like to have the preview images horizontally aligned(row) instead of vertical(column). I have tried playing with the style of the list container object but unfortunately I was not able to achieve any results.
    Is there a simple way to this?

    Thank you
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    ListView currently only supports vertical (column) layout. You'll have to use a simpler ScrollView instead and implement any virtualization you need in there.
     
  3. costeab

    costeab

    Joined:
    Apr 20, 2020
    Posts:
    10
    Thank you Damian.
     
  4. unity_8AB619225CA12290C803

    unity_8AB619225CA12290C803

    Joined:
    Dec 2, 2021
    Posts:
    1
    Hi there. Doesn't the 2021.3.4f1 version also support horizontal layout?
     
  5. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Is horizontal support still missing? :eek:
     
  6. unity_483C4357D3269025FA3B

    unity_483C4357D3269025FA3B

    Joined:
    Jul 2, 2022
    Posts:
    20
    Incredible that it's still missing...
     
  7. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Hi @antoine-unity
    Really sorry to tag you like that, but if you could tell when we can expect horizontal layout for listview?
     
  8. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    Another vote here. It's an incredible amount of work to recreate all the ListView functionality in horizontal layout - particularly with drag & drop, multi-select, animations etc.
    Made so so much harder due to the prodigious use of private & internal and the move away from UITK as a package. Almost all because there are about 5 places where verticality is baked in that would be trivial to generalise with access to source. We upgraded to 2022.1 in the hopes that MultiColumnListView would help but it has since become clear this is meant for something very different. Any tips on how to implement are appreciated.
     
  9. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    And to save someone else the time… the great hack that I tried doesn’t work either. Should probably be reported as its own bug but: (not too surprisingly) rotating a ListView (and counter rotating the contents) can render ok but breaks expected reordering of elements - meaning drag and drop reordering always happens in y screen space no matter list orientation.
     
  10. The-Wand3rer

    The-Wand3rer

    Joined:
    May 14, 2019
    Posts:
    32
    2023 calling for support to horizontal layout in ListView.
     
    berber_hunter and spakment like this.
  11. achimmihca

    achimmihca

    Joined:
    Feb 13, 2016
    Posts:
    283
    Oh my gosh, I am shocked that horizontal ListView is still not a thing in UIToolkit!

    is there any alternative implementation that we could use? Anyone here made a workaround?

    Sadly, ScrollView is not an option for me because my list can contain thousands of entries, which would be too slow.
     
    Last edited: Apr 24, 2023
    spakment likes this.
  12. achimmihca

    achimmihca

    Joined:
    Feb 13, 2016
    Posts:
    283
    Last edited: Apr 24, 2023
    spakment likes this.
  13. antonieo

    antonieo

    Joined:
    Oct 18, 2017
    Posts:
    2
    Please! We need horizontal listview
     
    MeTimeDev likes this.
  14. braty-xd

    braty-xd

    Joined:
    Jun 3, 2021
    Posts:
    6
    It blows my mind this thing is still missing, even weirder thing is they have vertical but not horizontal, like it shouldn't be that hard to also implement horizontal when you have vertical. In GCD they talked about how they aim to make UI Toolkit recommended UI solution for runtime till 2023 LTS, wonder how this is going to play out
     
    tpunblizzard and blminaca like this.