1

In my Xamarin.Forms project I need a horizontal carousel swiping of only one element at a time. Is it possible by means of CarouselView? Suggestions?

This is my current CarouselView definition:

<CarouselView AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1"
    ItemsSource="{Binding Homes}" ItemTemplate="{StaticResource HomeTemplate}"
    PeekAreaInsets="0" IsSwipeEnabled="True" Loop="False" IsScrollAnimated="False" ItemsUpdatingScrollMode="KeepItemsInView" HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
    <CarouselView.ItemsLayout>
        <LinearItemsLayout Orientation="Horizontal" ItemSpacing="0"  />
    </CarouselView.ItemsLayout>
</CarouselView>
AndreaGobs
  • 338
  • 2
  • 18

1 Answers1

4

You could set the SnapPointsType as MandatorySingle .Which indicates the same behavior as Mandatory, but only scrolls one item at a time.

<CarouselView.ItemsLayout>
     <LinearItemsLayout Orientation="Horizontal" ItemSpacing="0" SnapPointsType="MandatorySingle"  />
</CarouselView.ItemsLayout>
Lucas Zhang
  • 18,630
  • 3
  • 12
  • 22