如何使用Xamarin在CarouselPage中实现没有Scrollbar的ListView?

时间:2017-07-10 15:09:11

标签: listview xamarin scrollbar cross-platform carousel

在我的Xamarin项目中,我正在使用CarouselView。我在carousel的datatemplate中有一个Scrollview,在这个Scrollview中,我有一些元素(Grid,Labels等)和一个ListView。问题:我的内容中有2个滚动条。我想禁用Listview的滚动条,这样我就可以在我的carousel的datatemplate中显示Listview的每个元素,但是对于Xamarin的Listview来说是不可能的。

由于CarouselPage的datatemplate,我无法访问我的Xaml元素。所以我不能用C#编程。 (或者我错过了什么,这不是不可能!)

我只想在Carousel的datatemplate中使用我的自定义ViewCell显示我的所有元素(mySource)而没有第二个滚动条。

我有这样的事情:

<CarouselView>
  <CarouselView.ItemTemplate>
    <DataTemplate>
      <ScrollView>
        <Grid>
          <!-- Some items in the Grid then the ListView-->
          <ListView ItemSource = "{Binding mySource}" HasUnevenRows="True">
            <ListView.ItemTemplate>
              <DataTemplate>
                <ViewCell>
                  <!-- my custom view -->
                </ViewCell>
              </DataTemplate>
            </ListView.ItemTemplate>
          </ListView>
        </Grid>
      </ScrollView>
    </DataTemplate>
  </CarouselView.ItemTemplate>
</CarouselView>

PS:对不起我的英文

0 个答案:

没有答案