question

Surbhi-0157 avatar image
0 Votes"
Surbhi-0157 asked JarvanZhang-MSFT commented

How to disable vertical swipe in carousel view in xamarin forms android platform?

I have a carousel view which changes its content on every swipe whether its vertical or horizontal. I need to change the view only on horizontal swipe. Any suggestions.

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT commented

Hello,​

Welcome to our Microsoft Q&A platform!

I have a carousel view which changes its content on every swipe whether its vertical or horizontal.

What view do you use to dispaly the carousel view? Do you create a custom layout with swipe gesture for this function? Xamarin.Forms provides the CarouselView control which presents data in a scrollable layout, and users can swipe to move through a collection of items in it. CarouselView only supports the single swipe: horizontal or vertical. By default, a CarouselView will display its items in a horizontal orientation.

Here is the related doc:
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/carouselview/

Best Regards,

Jarvan Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am using CarouselView control provided by Xamarin.

0 Votes 0 ·

Hi, Surbhi. I reproduced the issue on my side, the carouselView does support vertical and horizontal swipe. And the values of swiping's MotionEvent.Action in two directions are the same. This may be a potential issue and someone has reported the problem to the product team on github. You could follow the topic for a solution or post your
questions on it if the requirement is not the same.

0 Votes 0 ·