SkiaLayout(column) to auto adjust in height when items are invisible #171
-
|
Hi - in Maui i can create a VerticalStackLayout, add child views to Stack and then if i make any of them InVisible(false) the stack collapses to the new height of the views contained. When using SkiaLayout = Column and try the same thing the stack does not collapse/adjust in height but leaves a blank placeholder of the previous view. Does the canvas need a redraw to see the change or something else i maybe missing? Ad |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 2 replies
-
|
Hi, there are 2 possibilities: |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, will check it now. |
Beta Was this translation helpful? Give feedback.
-
|
Hmm so i pasted your code inside the |
Beta Was this translation helpful? Give feedback.
-
|
preview nuget will be here for some time: Please let me know if this fixes what you have found, if not would need more of your code to replicate context. Thank you so much for helping to make it better. |
Beta Was this translation helpful? Give feedback.
-
|
Hey just catched this mess you described myself inside a templated stack. Was yours stack with itemtemplate too? Point is for such case you would need to call Reason is templated cells have always IsParentIndependent set by stack to true, so they never invalidate the parent in order not to create lags when scrolling cells of different height. I would think on how to implement the logic "invalidate parent if already on screen". Actualy templated stack is full of hacks for smooth scrolling inside scroll, my bet that would all change into a more clean solution. |
Beta Was this translation helpful? Give feedback.
-
|
in my case inside the cell i did: if ShowDate dinamically changes (your case like you click on something and it changes height) it invalidates the stack. |
Beta Was this translation helpful? Give feedback.
-
|
That Parent.Invalidate(); is rather costly, ill put very soon a new nuget, there you could call cell.Parent.InvalidateByChild(cell); after cell wants to rebuild self in real-time, i mean when already on the screen, and it would fast remeasure only this 1 cell, works fine for my chat messages scroll im currently working at. :) |
Beta Was this translation helpful? Give feedback.

in my case inside the cell i did:
if ShowDate dinamically changes (your case like you click on something and it changes height) it invalidates the stack.