|
Post by meneleus on May 11, 2023 10:55:12 GMT
Greetings,
Thank you for the great component. I have been trying to create a chat window using EnhancedScroller. For the most part it seems to be working. I am using code similar to the old example 16. Where you passed in a "calculateLayout" flag to SetData in which the cell did a Canvas.ForceUpdateCanvases() and then set a cellSize on the Data. I believe this used to work fine, but in the latest version I notice that I get exponentially large amounts of disabled cells. This does not happen in the other cases where I use the EnhancedScroller.
I went back and re-checked the example in case something has changed since I last worked on this code. What I noticed is you no longer have an example where the content is dynamic. You basically just manually calculate the size. Which is approximate and is going to be very tough with different languages...
I should note I've replaced the Canvas.ForceUpdateCanvases() with LayoutRebuilder.ForceRebuildLayoutImmediate(RectTransform) which seems to work much better for me.
Do you have a better solution?
Thank you!
|
|
|
Post by meneleus on May 11, 2023 11:06:34 GMT
It looks like the old cells are never being deleted. I thought you would be recycling them? I modified your _RecycleCell to rename my cells and sure enough the cells are being recycled, but they never get used again...
Apologies for being dense! After tracing through your code I realized I was setting a cell identifier in the GetCellView handler but not in the prefab. So the recycler was never able to get a recycled cell! :/
I have a different problem now. When the cells are reused the cellSizes are never updated.
All fixed now. I had to change how the cell sizes where calculated so that it automatically only calculates them once on a given Data.
|
|
|
Post by echo17 on May 12, 2023 12:50:35 GMT
Glad you found a solution, thank you for updating!
|
|