简体   繁体   English

如何在具有Windows Phone应用程序不同布局的列表框中实现虚拟化

[英]How to attain virtualization in listbox with different layouts of Windows Phone App

I have a List box with different user controls in WP7 app. 我在WP7应用中有一个带有不同用户控件的列表框。 How should I apply virtualization with Virtualization Mode as "recycling". 我应如何将虚拟化与虚拟化模式一起应用为“回收”。 Because when I applied the results are not smooth. 因为当我应用时结果并不流畅。 There seem to be a jerk while scrolling. 滚动时似乎有点混蛋。 In Android, for the same scenario the User Controls will be tagged their recycling is handled preoperly since they are perfectly distinguished and here any such option is not given. 在Android中,对于相同的情况,用户控件将被标记,因为它们的区别非常明显,并且在此未给出任何此类选项,因此将对其回收进行操作前的操作。

Any idea how to handle this scenario? 任何想法如何处理这种情况?

I tagged silverlight and c# becuase WP7 has both sides when adding any such properties. 我标记了silverlight,并在添加任何此类属性时将c#当作WP7的两面。

The behaviour you see is due to the items in the list being of different heights. 您看到的行为是由于列表中的项目高度不同。 This causes the list to constantly need to remeasure the contents and the scroll offsets become incorrect as items are removed from the list, hence the jumpiness. 这导致列表始终需要重新测量内容,并且随着项目从列表中删除,滚动偏移变得不正确,从而导致跳转。

Your best bet for smooth scrolling is to use items of the same height or not use virtualisation. 平滑滚动的最佳选择是使用相同高度的项目,或者不使用虚拟化。

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

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