Jan
Jan

Reputation: 19

How Disable Gestures (swipe l/r) of CarouselPage?

I want to use CarouselPage to have the right-to-left transition animation. Could you please help me disable getsures in CarouselPage? I can't do that.

Thanks.

Upvotes: 0

Views: 2358

Answers (1)

Mario Galván
Mario Galván

Reputation: 4032

Setting InputTransparent of the CarouselPage will do the thing:

public App ()
{
    MainPage = new CarouselPage{
        InputTransparent = true, //This!
        Children = {
            new ContentPage{
                Content = new Label{
                    Text = "Page 1",
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                }
            },
            new ContentPage{
                Content = new Label{
                    Text = "Page 2",
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                }
            }
        }
    };
}

Upvotes: 2

Related Questions