简体   繁体   English

Xamarin.Forms ListView 滚动缓慢且生涩

[英]Xamarin.Forms ListView scrolling slow and jerky

I have a ListView with 1 million records.我有一个包含 100 万条记录的 ListView。

I can preload the ListView from a flat file or database (about 8 secs).我可以从平面文件或数据库中预加载 ListView(大约 8 秒)。

Or, load 1 million empty records into the ListView (about 1 sec), and then populate the values on the fly when ItemAppearing().或者,将 100 万条空记录加载到 ListView(大约 1 秒)中,然后在 ItemAppearing() 时动态填充这些值。

I choose the latter and it works well for Xamarin Forms 3.3.我选择后者,它适用于 Xamarin Forms 3.3。

As soon as I upgrade past 3.3 however, the scrolling becomes slow and jerky.然而,一旦我升级到 3.3,滚动就会变得缓慢而生涩。 I've tried multiple versions of upgrades over the past year and all have the same problem, meaning I'm stuck on 3.3 and am missing out on any of the benefits of later versions.在过去的一年里,我尝试了多个版本的升级,但都遇到了同样的问题,这意味着我被困在 3.3 上,并且错过了更高版本的任何好处。

Anyone know why this might be occurring and how I might fix it.任何人都知道为什么会发生这种情况以及我如何解决它。 Or can anyone suggest a better design I could try.或者任何人都可以建议我可以尝试的更好的设计。

(My listview items are actually also crashing with an object disposed error occasionally when the app is brought back into memory after being unloaded, but if I was able to upgrade, I suspect this problem might go away.) (当应用卸载后重新进入内存时,我的列表视图项目实际上也偶尔会因对象处理错误而崩溃,但如果我能够升级,我怀疑这个问题可能会消失。)

1 million records is a lot of records. 100 万条记录是很多记录。 You should go for pagination.你应该去分页。 For smooth scrolling of listview you should set CachingStrategy="RecycleElement"为了平滑滚动列表视图,您应该设置CachingStrategy="RecycleElement"

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

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