xamarin如何在启动时设置carouselview当前页

tuwxkamq  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(131)

嗨,我正在使用此转盘视图:https://stackoverflow.com/a/64639210/18463835
我想在打开页面时在旋转式视图主页上设置第3页,但我不能。我尝试了以下方法:

MainPageCarouselView.CurrentItem = 2;

它不工作。我有5页现在,但我认为所有的网页是10+,我想设置主要carouselView项目,以第一次开始的中心,也设置指示器视图,以中心页。我的carouselView:

<CarouselView
  x:Name="MainPageCarouselView"
  IndicatorView="{x:Reference MainContentPageViewIndicatorView}"
  IsSwipeEnabled="True"
  ItemTemplate="{StaticResource MainContentPageViewSelector}"
  ItemsSource="{Binding _mainContentPageViewItemsSource}"
  Loop="True"
  PeekAreaInsets="35"/>
  
<IndicatorView
  x:Name="MainContentPageViewIndicatorView"
  Margin="0,50,0,80"
  HorizontalOptions="FillAndExpand"
  IndicatorColor="White"
  IndicatorsShape="Circle"
  SelectedIndicatorColor="Black"
  VerticalOptions="EndAndExpand"/>

现在有5页,但它将10+,这是在中心页i want make this page on center

tzdcorbm

tzdcorbm1#

刚凝固;

MainPageCarouselView.Position = 2;

相关问题