AndreiMisiukevich / CardView

CardsView | CarouselView | CoverflowView | CubeView for Xamarin.Forms
MIT License
710 stars 114 forks source link

When making the window bigger on UWP, you see the card on the right side. #378

Closed rheesbeen closed 3 years ago

rheesbeen commented 3 years ago

When you make the window bigger on UWP. The card outside the window becomes visible. Expected behaviour is that it shouldn't become visible.

Thnx for your time and please let me know how i can help.

AndreiMisiukevich commented 3 years ago

@rheesbeen do you see the card only during resizing (and once you end resizing it disappears again). Or it is still visible after the end of resizing.

rheesbeen commented 3 years ago

It is still visible after the resize. It will rectify when you scroll a little or select an other page. I just saw that sometimes the item on the left side moves in during resize.

AndreiMisiukevich commented 3 years ago

interesting.

AndreiMisiukevich commented 3 years ago

Can you override the OnSizeChanged (OnSizeAllocated) of your page that you resize?

And perform a call there

carousel.ForceRedrawViews();

AndreiMisiukevich commented 3 years ago

Or even better, subclass the carouselView and override the method.


class MyCarousel : PanCardView.CarouselView {
        protected override void OnSizeChanged()
        {
            base.OnSizeChanged();
            Device.BeginInvokeInMainThread(() => {
                ForceRedrawViews();
                RemoveUnprocessingChildren();
                LayoutChildren(X, Y, Width, Height);
                ForceLayout();
            });
        }
}
rheesbeen commented 3 years ago

Overriding the OnSizeAllocated does the trick. Did not try the subclass option, do you want me to try that also?

AndreiMisiukevich commented 3 years ago

Overriding the OnSizeAllocated does the trick. Did not try the subclass option, do you want me to try that also?

yes please

AndreiMisiukevich commented 3 years ago

Overriding the OnSizeAllocated does the trick. Did not try the subclass option, do you want me to try that also?

how does overridden method look like?

AndreiMisiukevich commented 3 years ago

try 2.7.3

rheesbeen commented 3 years ago

Yes! That resolved the issue. Thanks for your time,