Flex/QNX 滚动图库

发布于 2024-11-29 06:45:52 字数 435 浏览 2 评论 0原文

我希望有人能给我一些关于构建一个为 PlayBook 应用程序动态加载图像的图像库的指导。我已经上传了我想要实现的目标的快速模型,我想将图像动态加载到 QNX TileList 或 Flex 中等效的,当用户滚动列表时,我想动态调用图像的另一个“页面”。我已经制作了一个使用自定义单元格渲染器动态加载图像的示例,但是当我尝试确定用户何时到达列表末尾时遇到问题。

我尝试在用户滚动时使用列表的 lastVisibleItem 属性来确定列表中最后一个可见的项目是否也是 DataProvider 中的最后一个(这样我知道何时需要调用更多图像),但是当我将图像添加到DataProvider 它带我回到列表的开头,有人能告诉我原因吗?

任何有关不同方法或如何修改 TileList 的建议将不胜感激。

画廊模型

I was hoping someone could give me some guidance on building an image gallery which loads images dynamically for a PlayBook application.I've uploaded a quick mockup of what I am trying to achieve, I want to dynamically load images into a QNX TileList or Flex equivalent and as the user scrolls through the list I want to call another 'page' of images dynamically. I have already produced an example which uses a custom cell renderer to dynamically load images but I am having problems when I attempt to identify when the user has reached the end of the list.

I have tried using the lastVisibleItem property of the list while the user is scrolling to identify if the last item visible in the list is also last in the DataProvider (so I know when I need to call for more images) but when I add images to the DataProvider it takes me back to the start of the list, can anyone tell me the reason for this?

Any advice on a different approach or how to modify the TileList would be greatly appreciated.

Gallery MockUp

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会傲 2024-12-06 06:45:53

当您更新 dataProvider 时,scrollPosition 自动重置为 0。我已经完成了一些解决方法,即在更新 dataProvider 之前存储当前的 scrollPosition,然后在 dataProvider 更新完成后重新设置它。如果您需要一些代码示例,请告诉我,我会看看是否可以挖掘一些东西。


另一种选择是使用 dataPaging。以下是如何执行此操作的一个很好的示例:

http ://www.jamesward.com/2010/10/11/data-paging-in-flex-4/

The scrollPosition automatically gets reset to 0 when you update the dataProvider. I've done workarounds that store the current scrollPosition before updating the dataProvider and then re-set it after the update to the dataProvider has completed. Let me know if you need some code sample and I'll see if I can dig something up.


Another option would be to use dataPaging. Here is a good example of how to do that:

http://www.jamesward.com/2010/10/11/data-paging-in-flex-4/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文