简体   繁体   English

Xamarin.Forms的FastScrolling ListView

[英]FastScrolling ListView with Xamarin.Forms

I would like to have my Xamarin.Forms ListView (XAML) FastScroll. 我想要Xamarin.Forms ListView(XAML)FastScroll。 I already wrote a CustomRenderer for Android and set Control.FastScrollEnabled = true; 我已经为Android编写了CustomRenderer并设置了Control.FastScrollEnabled = true; . But unfortunately this is not enough to make it work. 但是不幸的是,这还不足以使其发挥作用。 As described here the Adapter needs to implement ISectionIndexer . 如上所述这里适配器需要实现ISectionIndexer

In my case the Adapter on the ListView does not ( HeaderViewListAdapter ). 在我的情况下,ListView上的适配器没有( HeaderViewListAdapter )。 Does anyone have an Idea how this problem can be solved? 有谁知道如何解决这个问题? I already tried to write a wrapper for the Adapter, but can't get it work (gets never called because I think a ListView's Adapter can not be switched after it has been set once). 我已经尝试为Adapter写一个包装器,但是无法使其工作(永远不会调用,因为我认为ListView的Adapter设置一次后就无法切换)。

Thanks! 谢谢!

Ok, I was able to get it working. 好的,我能够使它工作。 I had to create a CustomView in XF that inherits ListView. 我必须在XF中创建一个继承ListView的CustomView。 And in a CustomRenderer I was able to create a new Adapter that implements ISectionIndexer 在CustomRenderer中,我能够创建一个实现ISectionIndexer的新适配器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM