Creating a Card Stack Layout in .NET MAUI
A card stack shows the top card in full with a slice of the cards behind it; swipe it away to reveal the next, swipe back to bring it back. Vladislav implements this as a custom Layout that also acts as its own ILayoutManager.
The Measure method calculates the control’s size, while ArrangeChildren shrinks and offsets each successive card to create the stacking effect, controlled by Spacing and CardScaling properties. For input, he uses a PanGestureRecognizer and notes that SwipeGestureRecognizer didn’t work on custom controls at the time. Swiping left to right removes the top card, and swiping right to left restores it.
If custom layouts have felt intimidating, this is a practical, contained example. The repository linked in the post includes other layouts and swipe directions.