Xamarin.forms Xamarin表单旋转视图一次只能滑动一个元素
在我的Xamarin.Forms项目中,我需要一次只对一个元素进行水平旋转滑动。可以通过旋转木马查看吗?建议 这是我当前的CarouseView定义: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
<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中测试它