Flex Spark List 鼠标滚轮滚动速度

发布于 2024-10-20 10:22:49 字数 138 浏览 7 评论 0原文

我有一个扩展 Spark 列表的组件,当我使用鼠标滚轮滚动时,它一次性滚动太多。我尝试在 List 类和 VerticalLayout 类中寻找处理鼠标滚轮滚动的处理程序来覆盖,但我找不到它。

我是否应该有另一种方法来改变这个,或者我错过了什么?

I have a component extending a Spark List, and when I scroll using the mouse wheel it scrolls too much in one go. I have tried looking for the handler that deals with mouse wheel scrolling in the List class and VerticalLayout class to override but I cannot find it.

Is there another way I'm supposed to change this, or am I missing something?

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

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

发布评论

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

评论(2

苹果你个爱泡泡 2024-10-27 10:22:49

MouseEvent.MOUSE_WHEEL 的“delta”属性定义一轮滚动将滚动多少行。您可以尝试在 MOUSE_WHEEL 处理程序中更改它(在捕获阶段)。例如,以下代码将逐行滚动:

        protected function init(event:FlexEvent):void
        {
            list.addEventListener(MouseEvent.MOUSE_WHEEL, list_mouseWheelHandler, true);
        }

        protected function list_mouseWheelHandler(event:MouseEvent):void
        {
            event.delta = event.delta > 0 ? 1 : -1;
        }

The "delta" property of MouseEvent.MOUSE_WHEEL defines how many lines will be scrolled by one wheel-scrolling. You could try changing it in the MOUSE_WHEEL handler (during capture phase). For example the following code will scroll line-by-line:

        protected function init(event:FlexEvent):void
        {
            list.addEventListener(MouseEvent.MOUSE_WHEEL, list_mouseWheelHandler, true);
        }

        protected function list_mouseWheelHandler(event:MouseEvent):void
        {
            event.delta = event.delta > 0 ? 1 : -1;
        }

少年亿悲伤 2024-10-27 10:22:49

“horizo​​ntalLineScrollSize”和“verticalLineScrollSize”属性确定当用户选择滚动条箭头时要滚动的像素数。 “verticalLineScrollSize”属性还控制使用“鼠标滚轮”时的滚动量。默认值为 5 像素。
“horizo​​ntalPageScrollSize”和“verticalPageScrollSize”属性确定当用户选择“滚动条轨道”时要滚动的像素数。默认值为 20 像素。

更多详细信息:http://livedocs.adobe.com/ flex/3/html/help.html?content=containers_intro_4.html

The "horizontalLineScrollSize" and "verticalLineScrollSize" properties determine how many pixels to scroll when the user selects the scroll bar arrows. The "verticalLineScrollSize" property also controls the amount of scrolling when using the "mouse wheel". The default value is 5 pixels.
The "horizontalPageScrollSize" and "verticalPageScrollSize" properties determine how many pixels to scroll when the user selects the "scroll bar track". The default value is 20 pixels.

More details: http://livedocs.adobe.com/flex/3/html/help.html?content=containers_intro_4.html

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