刷新时手风琴会闪烁

发布于 2024-10-21 08:18:16 字数 332 浏览 1 评论 0原文

我有一个手风琴,里面有一个中继器。该中继器采用数组作为数据提供者。该数组又通过 HTTPService 从服务器上的 XML 文件获取数据。

现在,XML 文件中的数据在一段时间后会频繁修改,因此我使用计时器每 5 秒发送一次 HTTPService。

问题: 当计时器在 5 秒后超时时,将发送 HttpService,检索数据并在手风琴中显示,但每次发生这种情况时,手风琴都会闪烁。因此,每 5 秒就会出现一次闪烁,这非常令人恼火。

我可以以某种方式消除闪烁以使手风琴无缝更新吗? 如果这是手风琴的问题,如果我使用 DataGrid 代替手风琴,它会持续存在吗?

I have an accordion which contains a repeater. That repeater takes an array as a dataprovider. The array in turn gets data from an XML file, on server, via HTTPService.

Now, data in the XML file gets modified after sometime frequently so I send the HTTPService after every 5 secs by using a Timer.

Problem:
When the timer timesout after 5 secs, HttpService is sent, data is retrieved and showed in accordion but each time this happens, the accordion flickers. Thus, the flickering happens every 5 sec which is quite irritating.

Can I somehow remove the flickering to make the accordion update seamlessly?
If it's the problem with accordion, will it persist if I use a DataGrid in place of accordion?

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

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

发布评论

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

评论(1

无声静候 2024-10-28 08:18:16

闪烁通常表示帧速率较低,并且并非特定于某一类型的组件。如果没有任何代码,很难知道您做错了什么,但我怀疑您可能在一帧中处理了太多 XML,并且错误地使用了 Repeater 组件。

数据网格应该能够处理大量数据而不会出现闪烁问题,因为它只呈现当前在用户屏幕上可见的几行。

中继器内置的性能优化很少。如果您需要重复大量组件(超过 20 个),那么您应该使用 DataGrid 或 List。

Flickering is often an indication of a low framerate and is not specific to one type of component. Without any code its difficult to know what you are doing wrong but I suspect that you may be processing too much XML all in one frame and using the Repeater component incorrectly.

A Datagrid should be able to handle very large amounts of data without the flickering issue since it only renders the few rows that are currently visible on the user's screen.

A repeater has very few performance optimizations built into it. If you need to repeat large amounts of components (more than 20) then you should be using either a DataGrid or List.

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