【问题标题】:FastScrolling ListView with Xamarin.Forms使用 Xamarin.Forms 快速滚动 ListView
【发布时间】:2018-01-08 15:23:10
【问题描述】:

我想要我的 Xamarin.Forms ListView (XAML) FastScroll。 我已经为 Android 编写了一个 CustomRenderer 并设置了Control.FastScrollEnabled = true;。但不幸的是,这还不足以让它发挥作用。如here 所述,适配器需要实现ISectionIndexer

在我的情况下,ListView 上的适配器没有 (HeaderViewListAdapter)。 有谁知道如何解决这个问题?我已经尝试为适配器编写一个包装器,但无法使其工作(从未调用过,因为我认为 ListView 的适配器在设置一次后无法切换)。

谢谢!

【问题讨论】:

  • In my case the Adapter on the ListView does not (HeaderViewListAdapter). 是什么意思? Here is a video about fast scroll
  • HeaderViewListAdapter 没有实现ISectionIndexer

标签: android listview xamarin xamarin.forms xamarin.android


【解决方案1】:

好的,我能够让它工作。我必须在 XF 中创建一个继承 ListView 的 CustomView。在 CustomRenderer 中,我能够创建一个实现 ISectionIndexer 的新适配器

【讨论】: