如何在 Flex 中知道用户何时完成了浏览器窗口大小的调整
在用户调整浏览器窗口大小后,我需要对组件进行一些更新。是否有一个好的解决方案来确定用户何时完成调整大小?我找不到任何可以涵盖这种情况的弹性事件。
I need to do some updates to components after a user has resized the browser window. Is there a good solution to determine when a user has completed resizing? I wasn't able to find any flex events that would cover this case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,没有“完美”的解决方案。您得到的只是重复的 RESIZE 事件。用户可以随时停止调整大小并再次恢复,这是不可预见的。
最好的(但不是近乎完美)的解决方案可能是在收到 RESIZE 事件时启动计时器。当计时器触发时,执行您必须执行的操作(调整大小完成)。当计时器仍在运行时收到 RESIZE 事件时,忽略该事件并重新启动计时器。
There's no "perfect" solution unfortunately. All you get is repeated RESIZE events. The user can stop resizing, and resume again, at any time, which is not foreseeable.
Probably the best (but not nearly perfect) solution would be to start a timer when you get a RESIZE event. When the timer fires, do what you have to do (resize complete). When you get a RESIZE event while the timer is still running, ignore the event and restart the timer.