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

New UI Widgets

Discussion in 'Assets and Asset Store' started by ilih, Feb 11, 2015.

  1. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    You are right, it is a bug, it should be
    n
    instead of
    group.Rows
    .
    minPrefLerp = Mathf.Clamp01((size - sizes.TotalMin - ((n - 1) * spacing)) / (sizes.TotalPreferred - sizes.TotalMin));


    Same with
    ShrinkToFit()
    method
     
    YuriPetskus likes this.
  2. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    It is paginator pages instances: 6 pages (1 yellow square for the current page and 5 dark yellow squares for the other pages), not ListView items instances.

    Please check Examples / ListView / ListViewImages / ListViewDefaultItemResize.cs script.
    DefaultItem resize done in
    ResizeDefaultItem()
    method
    Script has a simple scaling.
    Code (CSharp):
    1.             var scale = ListView.IsHorizontal()
    2.                 ? RectTransform.rect.width / ListViewSize.x
    3.                 : RectTransform.rect.height / ListViewSize.y;
    4.  
    5.             ListView.ChangeDefaultItemSize(DefaultItemSize * scale);
    It can be replaced with fixed padding:
    Code (CSharp):
    1.             var padding = 30f; // from left and right side
    2.             var width = RectTransform.rect.width - (padding * 2);
    3.             var scale = width / DefaultItemSize.x; // scale to preserve aspect ratio
    4.             var size = new Vector2(width, DefaultItemSize.y * scale);
    5.  
    6.             ListView.ChangeDefaultItemSize(size);
     
    jGate99 likes this.
  3. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    How can I detect when a listview is scrollable (which means there will be invisible items) and when not (all items visible)
    So when all items are visible i can disable scrolling behaviour, when items are less
    please advise
     
  4. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    You can compare the sizes of ListView.Container and ScrollRect.viewport:
    var has_scroll = ListView.Container.rect.height > ListView.ScrollRect.viewport.rect.height;

    (replace height with width if horizontal scroll)
    Subscribe to the
    ListView.OnUpdateView
    event, and there compare sizes to enable/disable scrolling.
     
    jGate99 likes this.
  5. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    And how do I actually enable disable scrolling?
     
  6. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    ListView.ScrollRect.vertical = false;

    or horizontal.
     
    jGate99 likes this.
  7. malshoff5

    malshoff5

    Joined:
    Oct 31, 2019
    Posts:
    4
    When I generate widgets based on a simple class, it detects the thrse fields correctly, but upon generating and creating the new scene, it doesn't generate all of the prefab as it should,like how it works in your video on it.

    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class Player
    7. {
    8.     public int Overall { get; set; }
    9.     public int Price { get; set; }
    10.  
    11.     public string Name { get; set; }
    12.  
    13.     public Player(string name, int ovr, int price)
    14.     {
    15.         Name = name;
    16.         Overall = ovr;
    17.         Price = price;
    18.     }
    19.  
    20. }
    21.  
    The generated WidgetsPlayer/Prefabs folder only contains PrefabsMenuPlayer, but none of the others that should hve been generated. Is there a bug? It doesn't work like it does in your video in the docs.

    Also, the scene that it brings me to after generation is complete doesn't work. https://imgur.com/a/7lIA7oz


    Edit: I was able to fix this by fixing the bug in FontStyles.cs and having it use the LegacyRuntime font instead of Arial (which is no longer supported), and then generating widgets again.
     
    Last edited: Jan 3, 2023
  8. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Sorry about that, I know this problem and it should be fixed in the latest beta. But beta has not been fully tested yet to release.
     
    hopeful likes this.
  9. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih

    I have a parent list view with variable height header in it.
    That header has multiple horizontal list views, and also ListViewBanners

    Now problem is, when we put ListViewBanners inside list view then its Banner's horizontal swipe effects goes away
    Please advise
     
  10. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    313
    For the object slider scene.. is it possible to have one that just works as a button? without needing to be in a listview?

    The scenerio I have is the actual button needs to go in a sort of container sorta list (but a fully expanded list that doesn't have any up/down scroll so always expanded to its full height would rather just use a easylayout to arrange vertically).. where if I add/remove a button in the -container it adjusts the container height to match all the button heights.. I tried remaking the existing to object slide scene with a 2nd scrollview but the swiping left/right of the buttons didn't work.. so wondering about it now as I really need it.


    =scrollview
    --container
    ---button
    ---button
    ---button
    ---button
    --

    --container
    ---button
    ---button
    ---button
    --
    -

    upload_2023-1-4_9-38-29.png
     
    Last edited: Jan 4, 2023
  11. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Please show the hierarchy, a video or scene with this problem also be helpful.
     
  12. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    To do this you need to:
    1. move ListView.Container gameobject under ListView in the hierarchy
    2. remove ScrollRect with Viewport gameobject
    3. remove ContentSizeFitter from ListView.Container
    4. add EasyLayout to ListView with Children Height = Set Preferred
    5. add ContentSizeFitter to ListView with Vertical Fit = Preferred Size
    This way ListView will display all items without scroll.
    Note: resize direction is controlled by a ListView.RectTransform.pivot.

    You need to add buttons, main button should have ObjectSliding and ObjectSlidingHelper with references to the left and right buttons.

    Please check the scene in the attached package.
     

    Attached Files:

  13. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    v1.15.10 released

    Changelog:
    • Unity 2022.2 support
    • domain reload support: fixed null reference exception
    • Autocomplete: now input with tags is correctly parsed
    • Combobox: now correctly updated when item properties changed
    • Combobox: position in hierarchy correctly restored after ListView closed
    • Combobox: fixed use ListView.Select()/Deselect() with raiseEvents = false
    • EasyLayout: fixed Grid layout bug
    • ListView: fixed GetComponentsEnumerator() returns not all instances
    • ListView: minor fixes
    • ListViewPaginator: fixed LoopedList support
    • ResizableHandles: added HandlesState field to control handles visibility on select/deselect events
    • RotatableHandles: added HandleState field to control handles visibility on select/deselect events
    • TreeView: fixed ContainerMaxSize, now the size is correct if TreeView has collapsed nodes
     
    hopeful likes this.
  14. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    Can you please provide SelectableHelper that takes array of graphic element, useful when we want to apply same colors tint to multiple elements and more preformant than using seperate SelectableHelper
     
  15. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Ok.
     
    jGate99 likes this.
  16. malshoff5

    malshoff5

    Joined:
    Oct 31, 2019
    Posts:
    4
    Anyone have examples of how they've reskinned the default tables or other elements? For example, I'm making a data driven game and I'd want to take the look in the direction of this game: https://store.steampowered.com/app/2237700/Football_Legend/ (click through the pictures to see their tables). How feasible would it be to reskin the widgets to look more presentable as in that game?
     
  17. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Almost all visual is done with the default Image component, so all it needs is to replace colors and sprites.

    Changing the table from the default skin to this one takes me a couple of minutes (without a scrollbar because new sprites are needed): replaced colors, removed unnecessary Image components, and changed layouts spacing (used to create borders).
    upload_2023-1-11_9-41-51.png
    Original table for the comparison:
    upload_2023-1-11_9-50-42.png
     
  18. malshoff5

    malshoff5

    Joined:
    Oct 31, 2019
    Posts:
    4
    Thanks a lot, that's about all I would need. Amazing project and support.
     
  19. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    Could you please provide a sample scene with List View Header Reveal working for LinearGroupedTileView
    Thanks
     
  20. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    added in v1.15.11b2

    • Create Header game object as Viewport child
    • set List.EasyLayout.MarginTop = default margin + header height
    • add ScrollRectHeader to the TileView and specify ScrollRect and Header
    or check the Examples \ TileView \ LinearGroupedTileView \ LinearGroupedTileViewWithHeader scene in v1.15.11b2
    upload_2023-1-26_0-47-27.png
     
    jGate99 likes this.
  21. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Thanks, appreciate prompt response
     
  22. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    Does double carousel support conditional number of slides? For example I have 5 double slides, but based on certain runtime conditions ill only show first 4 slides rather than 5. Thanks
     
  23. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    I sent an updated version in a private message.
    You can use
    RemoveSlide(index)
    to disable slides.
     
    jGate99 likes this.
  24. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Thanks @ilih
    Another question is, I want to set few properties on runtime on scrollblock items

    So just like ListView has ComponentCreated, ComponentsPool and Components which i use to set visual properties on runtime

    How do i do that for SCrollBlock?
    Thanks
     
  25. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    ScrollBlock has a
    ComponentsPool
    property with the
    OnCreate
    callbacks (and other callbacks), and
    Components
    field to access all visible instances.
    You need to create a derived class to use them.
     
  26. SeerSucker69

    SeerSucker69

    Joined:
    Mar 6, 2021
    Posts:
    68
    Quick dumb question from me: Where does it show me in the docs how to set the starting folder in the file dialog picker?
    eg if I want to start the view in D:/ directory.
     
  27. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Code (CSharp):
    1. var picker = PickerTemplate.Clone();
    2. picker.FileListView.CurrentDirectory = "D:/";
    3.  
    4. var value = await picker.ShowAsync(currentValue);
    It is worth checking if
    Directory.Exists();
    before changing it.

    FileDialog contains a reference on FileListView, which has the
    CurrentDirectory
    property.
     
    SeerSucker69 likes this.
  28. SeerSucker69

    SeerSucker69

    Joined:
    Mar 6, 2021
    Posts:
    68

    Thanks Champ!
     
  29. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    List has OnSelect event which triggers when we select an item with a "tap"
    But what if we require a long press event so we can do other things without selecting that item?
    Please advise
     
  30. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    You can try to use
    ListView.ItemsEvents.PointerDown
    and
    ListView.ItemsEvents.PointerUp
    .
    Save press time when PointerDown is raised.
    Compare saved time with the current time and deselect the item if needed when PointerUp is raised.
     
    jGate99 likes this.
  31. GTMeghana

    GTMeghana

    Joined:
    Jan 5, 2023
    Posts:
    16
    Hi @ilih
    Can you please provide the information whether asset New UI Widgets will support HoloLens2 device?
     
  32. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    I do not have a Hololens2 device, so I cannot check it.

    The asset is based on Unity UI and its API.
    You can check the default widgets: button, toggle, dropdown, etc, if they work without a problem then the New UI Widgets will also work fine.

    Here is information about Hololens integration with Unity UI.
     
  33. GTMeghana

    GTMeghana

    Joined:
    Jan 5, 2023
    Posts:
    16
    Thanks for your reply.
    Unity Ui widgets, dropdown, inputfield, button work in HoloLens.
     
  34. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    Closing or Opening throw error in SideMenu, it only happens when i'm using Sidebar when I openned an AdditiveScene and that additivescene is still there or unload and another addditivescene loaded
    Please advise

    NullReferenceException: Object reference not set to an instance of an object
    UIWidgets.Sidebar.ModalClose () (at Assets/New UI Widgets/Scripts/Sidebar/Sidebar.cs:824)
    UIWidgets.Sidebar.SetModal (System.Boolean isOpen) (at Assets/New UI Widgets/Scripts/Sidebar/Sidebar.cs:778)
    UIWidgets.Sidebar.Animate (System.Boolean isOpen) (at Assets/New UI Widgets/Scripts/Sidebar/Sidebar.cs:1056)
    UIWidgets.Sidebar.Open () (at Assets/New UI Widgets/Scripts/Sidebar/Sidebar.cs:944)
     
  35. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Please try to replace the following line in Sidebar.cs
    Code (CSharp):
    1. ModalHelper.GetInstance(ModalKey.Value).transform.SetParent(UtilitiesUI.FindTopmostCanvas(transform), false);
    with this line
    Code (CSharp):
    1. var instance = ModalHelper.GetInstance(ModalKey.Value);
    2. if (instance != null)
    3. {
    4.     instance.transform.SetParent(UtilitiesUI.FindTopmostCanvas(transform), false);
    5. }
     
    jGate99 likes this.
  36. Radiant_Cadenza

    Radiant_Cadenza

    Joined:
    May 11, 2015
    Posts:
    5
    Hi, @ilih
    Is there a method to remove colors from the ColorsList component?
    It comes with an add color button but not a delete color button. I want player to be able to remove colors that are no longer needed.
     
  37. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    You can add a button to the DefaultItem and attach
    ListViewColorsComponent.RemoveItem()
    to the click event.
    upload_2023-3-11_16-53-34.png

    Or you can use
    ColorsList.ListView.DataSource.Remove(color);
    in your code.
     
  38. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935

    This issue also happens for Open, could you please fix for open too
    soemtime when scene is loaded then open wont work
     
  39. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Please check v1.16.0b10, problem should be fixed with this update.

    This update also adds UI Themes as a replacement for Styles, themes should be easier to use and customize.
     
    jGate99 likes this.
  40. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Getting following errors when i build

    Assets\New UI Widgets\Scripts\ListView\ListViewItem.cs(987,4): error CS0234: The type or namespace name 'UtilitiesEditor' does not exist in the namespace 'UIThemes' (are you missing an assembly reference?)
    Assets\New UI Widgets\Scripts\ListView\ListViewItem.cs(988,4): error CS0234: The type or namespace name 'UtilitiesEditor' does not exist in the namespace 'UIThemes' (are you missing an assembly reference?)
    Assets\New UI Widgets\Scripts\TreeView\TreeViewComponentBase.cs(428,4): error CS0234: The type or namespace name 'UtilitiesEditor' does not exist in the namespace 'UIThemes' (are you missing an assembly reference?)
    Assets\New UI Widgets\Scripts\TreeGraph\TreeGraphComponent.cs(181,4): error CS0234: The type or namespace name 'UtilitiesEditor' does not exist in the namespace 'UIThemes' (are you missing an assembly reference?)
    Assets\New UI Widgets\Scripts\TreeGraph\TreeGraphComponent.cs(182,4): error CS0234: The type or namespace name 'UtilitiesEditor' does not exist in the namespace 'UIThemes' (are you missing an assembly reference?)
     
  41. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Sorry, fixed it in v1.16.0b12
     
    jGate99 likes this.
  42. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    I'm using ListViewBanners, but unlike your scene example might doesnt behave like infinite/endless/circular (so last item shows the first item rather than not showing any item at all)
    Please advise what im doing wrong
    https://we.tl/t-uALnwosHeE
    Thanks
     
  43. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Please check Scroll Settings: Looped List should be enabled.
    upload_2023-3-23_2-29-55.png
     
    jGate99 likes this.
  44. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    So I have a Scroll View Stretched all sides (responsive) with Vertical Layout attached where width is Forced expand but height is control child size,
    and when i move ListViewBanner inside it then it doesnt work on runtime and I believe its because ListviewBannerResize gets x 0, y 0 and Item Size 0 values automatically,
    So ListViewBannerResize needs to work within scroll view, if you create an example you should see the issue.
    Thanks
     
  45. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Example in attachment.

    You need to change a few lines in
    OnValidate()
    method in Examples / ListView / ListViewImages / ListViewDefaultItemResize.cs
    old lines:
    Code (CSharp):
    1. ListViewSize = (list_view.transform as RectTransform).rect.size;
    2. DefaultItemSize = list_view.GetDefaultItemSize();
    Code (CSharp):
    1. var size = (list_view.transform as RectTransform).rect.size;
    2. // size can be zero because of the Vertical Layout Group
    3. var valid = !(Mathf.Approximately(size.x, 0f) || Mathf.Approximately(size.y, 0f));
    4. if (valid)
    5. {
    6.    ListViewSize = size;
    7.    DefaultItemSize = list_view.GetDefaultItemSize();
    8. }
     

    Attached Files:

    jGate99 likes this.
  46. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Hi @ilih
    Notice how my shared list view (multiple items) (IListViewTemplateSelector)
    is not showing all the items, but when i pressed start recording so i can send you video then all items appeared.
    Any idea why its happening?
    Please advise
    upload_2023-3-28_6-47-18.png
     
  47. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    Debug Info


    Direction: Vertical
    Type: ListViewWithVariableSize
    Virtualization: True
    DataSource.Count: 103
    Container Size: (387.00, 9734.21)
    Container Scale: (1.00, 1.00, 1.00)
    DefaultItem Size: (337.00, 12.00)
    DefaultItem Scale: (1.00, 1.00, 1.00)
    ScrollRect Size: (387.00, 800.00)
    Looped: False
    Centered: False
    Precalculate Sizes: True
    DisplayedIndices (count: 11): 0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10
    Components Indices (count: 11):
    0 PrefabDefaultItemText(Clone): 0
    1 PrefabDefaultItemText(Clone): 1
    2 PrefabDefaultItemControls(Clone): 2
    3 PrefabDefaultItemControls(Clone): 3
    4 PrefabDefaultItemControls(Clone): 4
    5 PrefabDefaultItemControls(Clone): 5
    6 PrefabDefaultItemControls(Clone): 6
    7 PrefabDefaultItemControls(Clone): 7
    8 PrefabDefaultItemControls(Clone): 8
    9 PrefabDefaultItemControls(Clone): 9
    10 PrefabDefaultItemControls(Clone): 10
    Templates (count: 5):
    0 PrefabDefaultItemText; Instances.Count: 2; Requested.Count: 0; Cache.Count: 0
    1 PrefabDefaultItemGroupHeader; Instances.Count: 0; Requested.Count: 0; Cache.Count: 0
    2 PrefabDefaultItemSeparator; Instances.Count: 0; Requested.Count: 0; Cache.Count: 0
    3 PrefabDefaultItemControls; Instances.Count: 9; Requested.Count: 0; Cache.Count: 0
    4 PrefabDefaultItemButton; Instances.Count: 0; Requested.Count: 0; Cache.Count: 0
    StopScrollAtItemCenter: False
    ScrollCenterState: None
    ScrollPosition: 0
    ScrollVectorPosition: (0.00, 0.00)
    #############
    **Renderer Info**
    IsTileView: False
    Max Visible Items: 11
    Visibility
    Visibility.FirstVisible: 0
    Visibility.LastVisible: 11
    Visibility.Items: 11
    First Visible Index: 0
    Last Visible Index: 15
    List Size: 9734.21
    Items Per Block: 1
    Top Filler: 0
    Bottom Filler: 9200
    Items
    0. size: (387.00, 43.60); position: 0; block: 0
    1. size: (387.00, 40.61); position: 43.6; block: 1
    2. size: (387.00, 50.00); position: 84.21; block: 2
    3. size: (387.00, 50.00); position: 134.21; block: 3
    4. size: (387.00, 50.00); position: 184.21; block: 4
    5. size: (387.00, 50.00); position: 234.21; block: 5
    6. size: (387.00, 50.00); position: 284.21; block: 6
    7. size: (387.00, 50.00); position: 334.21; block: 7
    8. size: (387.00, 50.00); position: 384.21; block: 8
    9. size: (387.00, 50.00); position: 434.21; block: 9
    10. size: (387.00, 50.00); position: 484.21; block: 10
    11. size: (1.00, 100.00); position: 534.21; block: 11
    12. size: (1.00, 100.00); position: 634.21; block: 12
    13. size: (1.00, 100.00); position: 734.21; block: 13
    14. size: (1.00, 100.00); position: 834.21; block: 14
    15. size: (1.00, 100.00); position: 934.21; block: 15
    16. size: (1.00, 100.00); position: 1034.21; block: 16
    17. size: (1.00, 100.00); position: 1134.21; block: 17
    18. size: (1.00, 100.00); position: 1234.21; block: 18
    19. size: (1.00, 100.00); position: 1334.21; block: 19
    20. size: (1.00, 100.00); position: 1434.21; block: 20
    21. size: (1.00, 100.00); position: 1534.21; block: 21
    22. size: (1.00, 100.00); position: 1634.21; block: 22
    23. size: (1.00, 100.00); position: 1734.21; block: 23
    24. size: (1.00, 100.00); position: 1834.21; block: 24
    25. size: (1.00, 100.00); position: 1934.21; block: 25
    26. size: (1.00, 100.00); position: 2034.21; block: 26
    27. size: (1.00, 100.00); position: 2134.21; block: 27
    28. size: (1.00, 100.00); position: 2234.21; block: 28
    29. size: (1.00, 100.00); position: 2334.21; block: 29
    30. size: (1.00, 100.00); position: 2434.21; block: 30
    31. size: (1.00, 100.00); position: 2534.21; block: 31
    32. size: (1.00, 100.00); position: 2634.21; block: 32
    33. size: (1.00, 100.00); position: 2734.21; block: 33
    34. size: (1.00, 100.00); position: 2834.21; block: 34
    35. size: (1.00, 100.00); position: 2934.21; block: 35
    36. size: (1.00, 100.00); position: 3034.21; block: 36
    37. size: (1.00, 100.00); position: 3134.21; block: 37
    38. size: (1.00, 100.00); position: 3234.21; block: 38
    39. size: (1.00, 100.00); position: 3334.21; block: 39
    40. size: (1.00, 100.00); position: 3434.21; block: 40
    41. size: (1.00, 100.00); position: 3534.21; block: 41
    42. size: (1.00, 100.00); position: 3634.21; block: 42
    43. size: (1.00, 100.00); position: 3734.21; block: 43
    44. size: (1.00, 100.00); position: 3834.21; block: 44
    45. size: (1.00, 100.00); position: 3934.21; block: 45
    46. size: (1.00, 100.00); position: 4034.21; block: 46
    47. size: (1.00, 100.00); position: 4134.21; block: 47
    48. size: (1.00, 100.00); position: 4234.21; block: 48
    49. size: (1.00, 100.00); position: 4334.21; block: 49
    50. size: (1.00, 100.00); position: 4434.21; block: 50
    51. size: (1.00, 100.00); position: 4534.21; block: 51
    52. size: (1.00, 100.00); position: 4634.21; block: 52
    53. size: (1.00, 100.00); position: 4734.21; block: 53
    54. size: (1.00, 100.00); position: 4834.21; block: 54
    55. size: (1.00, 100.00); position: 4934.21; block: 55
    56. size: (1.00, 100.00); position: 5034.21; block: 56
    57. size: (1.00, 100.00); position: 5134.21; block: 57
    58. size: (1.00, 100.00); position: 5234.21; block: 58
    59. size: (1.00, 100.00); position: 5334.21; block: 59
    60. size: (1.00, 100.00); position: 5434.21; block: 60
    61. size: (1.00, 100.00); position: 5534.21; block: 61
    62. size: (1.00, 100.00); position: 5634.21; block: 62
    63. size: (1.00, 100.00); position: 5734.21; block: 63
    64. size: (1.00, 100.00); position: 5834.21; block: 64
    65. size: (1.00, 100.00); position: 5934.21; block: 65
    66. size: (1.00, 100.00); position: 6034.21; block: 66
    67. size: (1.00, 100.00); position: 6134.21; block: 67
    68. size: (1.00, 100.00); position: 6234.21; block: 68
    69. size: (1.00, 100.00); position: 6334.21; block: 69
    70. size: (1.00, 100.00); position: 6434.21; block: 70
    71. size: (1.00, 100.00); position: 6534.21; block: 71
    72. size: (1.00, 100.00); position: 6634.21; block: 72
    73. size: (1.00, 100.00); position: 6734.21; block: 73
    74. size: (1.00, 100.00); position: 6834.21; block: 74
    75. size: (1.00, 100.00); position: 6934.21; block: 75
    76. size: (1.00, 100.00); position: 7034.21; block: 76
    77. size: (1.00, 100.00); position: 7134.21; block: 77
    78. size: (1.00, 100.00); position: 7234.21; block: 78
    79. size: (1.00, 100.00); position: 7334.21; block: 79
    80. size: (1.00, 100.00); position: 7434.21; block: 80
    81. size: (1.00, 100.00); position: 7534.21; block: 81
    82. size: (1.00, 100.00); position: 7634.21; block: 82
    83. size: (1.00, 100.00); position: 7734.21; block: 83
    84. size: (1.00, 100.00); position: 7834.21; block: 84
    85. size: (1.00, 100.00); position: 7934.21; block: 85
    86. size: (1.00, 100.00); position: 8034.21; block: 86
    87. size: (1.00, 100.00); position: 8134.21; block: 87
    88. size: (1.00, 100.00); position: 8234.21; block: 88
    89. size: (1.00, 100.00); position: 8334.21; block: 89
    90. size: (1.00, 100.00); position: 8434.21; block: 90
    91. size: (1.00, 100.00); position: 8534.21; block: 91
    92. size: (1.00, 100.00); position: 8634.21; block: 92
    93. size: (1.00, 100.00); position: 8734.21; block: 93
    94. size: (1.00, 100.00); position: 8834.21; block: 94
    95. size: (1.00, 100.00); position: 8934.21; block: 95
    96. size: (1.00, 100.00); position: 9034.21; block: 96
    97. size: (1.00, 100.00); position: 9134.21; block: 97
    98. size: (1.00, 100.00); position: 9234.21; block: 98
    99. size: (1.00, 100.00); position: 9334.21; block: 99
    100. size: (1.00, 100.00); position: 9434.21; block: 100
    101. size: (1.00, 100.00); position: 9534.21; block: 101
    102. size: (1.00, 100.00); position: 9634.21; block: 102
    #############
    **Layout Info**
    Layout: EasyLayout
    RectTransform.size: (387.00, 9734.21)
    localScale: (1.00, 1.00, 1.00)
    Main Axis: Horizontal
    Type: Compact
    Group Position: UpperLeft
    Row Align: Left
    Inner Align: Top
    Compact Constraint: Flexible
    Compact Constraint Count: 1
    PaddingInner: Padding(left: 0, right: 0, top: 0, bottom: 9200)
    Spacing: (0.00, 0.00)
    Margin Symmetric: True
    Margin: (0.00, 0.00)
    TopToBottom: True
    RightToLeft: False
    Skip Inactive: True
    Reset Rotation: False
    Children Width: DoNothing
    Children Height: SetPreferred
    Children: PrefabDefaultItemText(Clone): (387.00, 43.60)
    PrefabDefaultItemText(Clone): (387.00, 40.61)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    PrefabDefaultItemControls(Clone): (387.00, 50.00)
    UnityEngine.Debug:Log (object,UnityEngine.Object)
    UIWidgets.ListViewBase:PrintDebugInfo () (at Assets/New UI Widgets/Scripts/ListView/ListViewBase.cs:1887)
     
  48. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    What I see: precalculated item sizes are invalid:
    size: (1.00, 100.00)
    , but displayed items have the correct sizes.
    So the item sizes are properly changed when the item is displayed.
    But item resize event changes the flag
    ListView.NeedUpdateView
    to recalculate displayed items, this flag is checked in the
    RunUpdate()
    method. And looks like this method was never called for some reason.

    There are two possible reasons:
    • ListView.OnEnable()
      method is overridden and
      base.OnEnable()
      is not called.
    • something wrong with the updater: scene should have an active "New UI Widgets Updater Proxy" game object with the
      UpdaterProxy
      component. Is it exist and be active?
     
    Last edited: Mar 28, 2023
  49. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    So I just imported latest beta in Unity 2023.1b assuming that it'd solve the problem, but now Switch class is no longer "partial" able. I was able to use partial keyword on your switch class and add some functionality but not it doesnt seem to work. Please advise
     
  50. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,402
    Sorry, I do not understand it.
    Why Unity 2023.1 should fix it and why Switch should be partial?

    Regarding the previous message then most likely your ListView class looks like this:
    Code (CSharp):
    1. public class YourListView : ListViewCustom<..., ...>
    2. {
    3.    // ...
    4.  
    5.    public override void Init()
    6.    {
    7.       // ...
    8.    }
    9.  
    10.    public override void OnEnable()
    11.    {
    12.       // your code
    13.    }
    14. }
    You need to add
    base.OnEnable();
    to your
    OnEnable()
    method:
    Code (CSharp):
    1.    protected override void OnEnable()
    2.    {
    3.       base.OnEnable();
    4.       // your code
    5.    }
     
    jGate99 likes this.