简体   繁体   English

Xamarin Forms CollectionViews 在 Android 上的性能

[英]Performance of Xamarin Forms CollectionViews on Android

The CollectionViews on Xamarin are a really nice feature. Xamarin 上的 CollectionViews 是一个非常好的功能。 Though, I am struggling to get a decent performance, when loading items.不过,在加载项目时,我正在努力获得不错的性能。 And this only happens on Android.这只发生在 Android 上。 It is slow and there is this flickering.它很慢,并且有这种闪烁。 Strangely, on iOS it works like a charm.奇怪的是,在 iOS 上,它就像一个魅力。

  • The items have a grid, images (~15 Kb), labels buttons, about 9 visual elements这些项目有一个网格、图像 (~15 Kb)、标签按钮、大约 9 个视觉元素
  • Text, Images and Commands are bound to viewModel文本、图像和命令绑定到 viewModel
  • I'm using compiled bindings x:DataType=""我正在使用已编译的绑定 x:DataType=""

I am aware, that bindings are expensive.我知道,绑定很昂贵。 I've also tried AOT compilation.我也尝试过 AOT 编译。 So, if anyone has some tips..所以,如果有人有一些提示..

Thanks!谢谢!

While you haven't posted any code which makes it possibly for this to happen for any apparent reason, there is just one very likely answer - you are doing too much work on UI thread.虽然您没有发布任何代码可能导致这种情况发生,但答案很可能只有一个——您在 UI 线程上做了太多工作。 That is likely to affect Android much more than iOS because of their different underlying architectures.这可能对 Android 的影响比 iOS 大得多,因为它们的底层架构不同。

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

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