You can create a derived class with the overridden InitOnce() method to set callbacks on star get (or instantiate) from the pool and return to the pool.
Hi @ilih,
There is an issue with Rating, i have it as prefab with value set to 0.
First time when i instaniate it and set value to 0 on runtime it works.
then i as a user, select first star, then i return it back (setting inactive) and then i again get it from pool and set value to 0 but this time i get following errror.
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0)
UIWidgets.ListComponentPool`1[TItemView].get_Item (System.Int32 index) (at Assets/New UI Widgets/Scripts/CollectionsUtilities/ListComponentPool.cs:140)
UIWidgets.Rating.ValueChanged () (at Assets/New UI Widgets/Scripts/Rating/Rating.cs:370)
UIWidgets.Rating.set_Value (System.Int32 value) (at Assets/New UI Widgets/Scripts/Rating/Rating.cs:58)
is there any object that can block click on starts (like a transparent image), to do this select EventSystem and check its data at the bottom of the Inspector window - what objects are displayed in pointerEnter, pointerPress, and Current Raycast
The following objects are in the same column and have a total relative height of more than 1. It is not supported
UnityEngine.Debug:LogError (object)
EasyLayoutNS.LayoutElementsGroup:IsValidColumn (System.Collections.Generic.List`1<EasyLayoutNS.LayoutElementInfo>) (at Assets/New UI Widgets/Scripts/EasyLayout/LayoutElementsGroup.cs:375)
EasyLayoutNS.LayoutElementsGroup:Validate () (at Assets/New UI Widgets/Scripts/EasyLayout/LayoutElementsGroup.cs:335)
EasyLayoutNS.EasyLayoutBaseType:PerformLayout (System.Collections.Generic.List`1<EasyLayoutNS.LayoutElementInfo>,bool,EasyLayoutNS.ResizeType) (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayoutBaseType.cs:482)
EasyLayoutNS.EasyLayout:PerformLayout (bool,EasyLayoutNS.ResizeType) (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:1178)
EasyLayoutNS.EasyLayout:SetLayoutVertical () (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:997)
UnityEditor.Undo:Internal_CallWillFlushUndoRecord ()
This is my layout
Btw, first time when i add they work
but when i add them back then i get this error
You have elements with relative height (RectTransform: Anchor Min Y != Anchor Max Y) and their summary height is more than 1 (100% of container height), so it will cause an infinite height increase (combination of relative height of children and Children Height = Fit Container) until overflow error.
You need to replace this (vertical stretch):
As first time it works, i remove them from this layout, i add them again and this issue happens
so to solve this, before adding to layout i should set itt to top left?
Iâm encountering some weird behavior with TileViews that I hope you can help with.
I have a vertical TileView with variable size that I am assigning data to by first creating an ObservableList and then assigning it to the DataSource so something like this:
var items = new ObservableList<CustomItem>;
// populate the items list
TileView.DataSource = items;
Everything works fine until I try to change the data in the tileview after scrolling down the list.
For example, say I build the vertical TileView with 50 objects (top to bottom) and set it to 2 items per row (so 25 lines). Then, say I scroll down to row 15.
I then change the data in the tileview using a new list in TileView.DataSource = items. What happens next, is that, after the new data is loaded, the tileview jumps all the way to the bottom of the new list and then glitches when I try to back up to the top.
This behavior doesnât occur with ListViews: I set the data on a listview using ListView.DataSource = items and scroll down the list. I then change the data of the list. What happens in this case is that the ListView jumps back to the top of the page and the ListView works perfectly.
How can I make the TileView start over from the top when the data changes?
The TileView is set to âTileView with Vertical Sizeâ and âRetain Scroll Positionâ is not enabled
This is already disabled. So the issue occurs with this option disabled
The problem does not occur. So behavior is correct with these options.
Just in case, my settings for the TileView and Container.EasyLayout (where the error does occur) are TileView with Variable Size and the EasyLayout is as follows: