xamarin - 如何让活动指示器在集合视图的底部运行以指示正在加载更多项目?
问题描述
我想知道如何在 Xamarin Forms 的集合视图的页脚中添加一个活动指示器,以显示正在从服务器获取更多项目。
XAML
<CollectionView Grid.Row="1" x:Name="Posts" SelectionMode="Single" SelectionChanged="Posts_SelectionChanged" RemainingItemsThreshold="5" RemainingItemsThresholdReached="Posts_RemainingItemsThresholdReached">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout Padding="8, 8, 8, 0">
// Some XAML
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
解决方案
尝试在 CollectionView 中将阈值与活动指示器一起使用,并在对数据设置阈值时为活动指示器设置 IsVisible 等于 true。
推荐阅读
- javascript - Symfony,webpack,点击事件仅在 prod 环境中执行两次
- android - SystemChrome.setSystemUIOverlayStyle 在 iO 上不起作用
- macos - 安装特定的 PyTorch 版本(pytorch==1.0.1)
- eclipse - Robot Framework - 如何在 Eclipse 中导入 SeleniumLibrary 关键字实现/文档
- python - 是否可以让程序等到变量从 1 变为 0 或从 0 变为 1 才能执行某些操作?
- r - 如何使用 lapply 和 dplyr::filter 函数遍历列表?
- javascript - 如果单击按钮,如何删除输入字段?
- django - 使用两个提交按钮将 django inlineformset 保存为草稿
- vb.net - 在 VB.Net 的 Listview 中更改下载百分比
- ios - 当wifi和移动数据之间发生切换时,有没有办法使用NE Packet Tunnel Provider重置iOS中的隧道?