Xaml 在Xamarin Forms iOS中实现分组时,如何知道项目的集合视图滚动到底(最后一个项目)?
我想在滚动至结束时显示一个按钮。我尝试了多种方法 1) 使用“RemainingItemsThresholdReach”,但iOS存在已知问题 2) 使用“滚动”事件。但这里的问题是,当新组在视图中可见时,“LastVisibleItemIndex”以0开头。因此,与总体项目数量进行比较是不可能的。此外,我无法识别屏幕上显示的是哪个组 3) 在“GroupFooterTemplate”中添加按钮。但这里的问题是,我的按钮在所有组的末尾都是可见的,这是我不想要的。我只想显示在最后一组的末尾 4) 在“页脚模板”中添加按钮。它没有在ios中显示。这是代码Xaml 在Xamarin Forms iOS中实现分组时,如何知道项目的集合视图滚动到底(最后一个项目)?,xaml,xamarin,xamarin.forms,xamarin.android,xamarin.ios,Xaml,Xamarin,Xamarin.forms,Xamarin.android,Xamarin.ios,我想在滚动至结束时显示一个按钮。我尝试了多种方法 1) 使用“RemainingItemsThresholdReach”,但iOS存在已知问题 2) 使用“滚动”事件。但这里的问题是,当新组在视图中可见时,“LastVisibleItemIndex”以0开头。因此,与总体项目数量进行比较是不可能的。此外,我无法识别屏幕上显示的是哪个组 3) 在“GroupFooterTemplate”中添加按钮。但这里的问题是,我的按钮在所有组的末尾都是可见的,这是我不想要的。我只想显示在最后一组的末尾 4)
<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>
请让我知道是否有任何解决这个问题的办法
在“页脚模板”中添加按钮。它没有在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>
如果要在CollectionView(不是每个组)的末尾添加按钮。您需要使用
而不是
如果我没有说清楚,很抱歉,但我希望集合视图而不是列表视图使用此选项。它现在起作用了吗?如果有帮助,您可以接受我的答案:)