【问题标题】:How to get the activity indicator to run on the bottom of the collectionview to indicate that more items are being loaded?如何让活动指示器在集合视图的底部运行以指示正在加载更多项目?
【发布时间】:2021-03-08 01:52:15
【问题描述】:

我想知道如何在 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>

【问题讨论】:

标签: xamarin xamarin.forms collectionview activity-indicator


【解决方案1】:

尝试在 CollectionView 中使用 Threshold 和 Activity Indicator,并在对数据设置阈值时将 Activity Indicator 的 IsVisible 设置为 true。

【讨论】:

  • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多