Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin.forms Xamarin表单旋转视图一次只能滑动一个元素_Xamarin.forms_Carousel_Swipe - Fatal编程技术网

Xamarin.forms Xamarin表单旋转视图一次只能滑动一个元素

Xamarin.forms Xamarin表单旋转视图一次只能滑动一个元素,xamarin.forms,carousel,swipe,Xamarin.forms,Carousel,Swipe,在我的Xamarin.Forms项目中,我需要一次只对一个元素进行水平旋转滑动。可以通过旋转木马查看吗?建议 这是我当前的CarouseView定义: <CarouselView AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1" ItemsSource="{Binding Homes}" ItemTemplate="{St

在我的Xamarin.Forms项目中,我需要一次只对一个元素进行水平旋转滑动。可以通过旋转木马查看吗?建议

这是我当前的CarouseView定义:

<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>

您可以将SnapPointsType设置为
MandatorySingle
。这表示与强制相同的行为,但一次只能滚动一个项目

<CarouselView.ItemsLayout>
     <LinearItemsLayout Orientation="Horizontal" ItemSpacing="0" SnapPointsType="MandatorySingle"  />
</CarouselView.ItemsLayout>

是的,谢谢。它在Android中工作。我还将在iOS中测试它