在Xamarin Forms iOS中实现分组时,如何知道项目的集合视图滚动达到结束(在最后一个项目?)?

问题描述 投票:0回答:1
我想在滚动到达结束时显示一个按钮。我尝试了多种方法。

1)使用“ RemainingItemsThresholdReached”,但对于iOS存在已知问题。 Here it is

2)使用“滚动”事件。但是这里的问题是,当新组在视图上可见时,“ LastVisibleItemIndex”以0开头。因此,无法与总项目数进行比较。我也无法识别屏幕上可见的组。

3)在“ GroupFooterTemplate”中添加按钮。但是这里的问题是我不想在所有组的末尾看到我的按钮。我只想显示在最后一组的末尾。

4)在“ FooterTemplate”中添加按钮。它不在ios中显示。这是该代码。

<CollectionView.FooterTemplate> <DataTemplate><Frame BackgroundColor="GreenYellow" Padding="0,0,0,0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HeightRequest="40"> <Label Style="{StaticResource Header}" Text="LOAD MORE" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand"/> </Frame></DataTemplate> </CollectionView.FooterTemplate>

请让我知道是否有解决此问题的方法。

我想在滚动到达结束时显示一个按钮。我尝试了多种方法。 1)使用“ RemainingItemsThresholdReached”,但对于iOS存在已知问题。这是2)使用“滚动”事件。但是...

xaml xamarin xamarin.forms xamarin.android xamarin.ios
1个回答
0
投票
[FooterTemplate]中的添加按钮。它不在ios中显示。这是该代码。
© www.soinside.com 2019 - 2024. All rights reserved.