Adobe Flex / as3:如何实现自定义拖放光标
我们的产品团队要求在拖放操作期间使用自定义光标。 他们为我提供了三个要实现的图像:
- Open-Hand-Grabber.png:当用户将鼠标悬停在可以拖动的项目上时显示
- Closed-Hand-Grabber.png >:项目正在被拖动
- Closed-Hand-Grabber-No-Drop:项目被拖动到无法放置的区域
我已将这些图像嵌入到 Flex 应用程序中,现在正在尝试实现期望的行为。
我的第一个想法是监听拖/放事件并使用 CursorManager.setCursor() 方法设置光标。 这个解决方案似乎代码密集,我觉得必须有一种更简单的方法来对各种拖放光标状态进行皮肤处理。
有任何想法吗?
Our product team has requested custom cursors during drag/drop operations. They have provided me with three images to implement:
- Open-Hand-Grabber.png: displays when a user hovers over an item that they can drag
- Closed-Hand-Grabber.png: item is being dragged
- Closed-Hand-Grabber-No-Drop: item dragged over an area where it cannot be dropped
I have embedded these images into the Flex application and I am now trying to implement the desired behavior.
My first thought was to listen to the drag/drop events and set the cursors using the CursorManager.setCursor() method. This solution seems very code intensive and I feel that there must be an easier way to skin the various drag/drop cursor states.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 DragManager 类上可用的各种光标样式:
copyCursor
defaultDragImageSkin
linkCursor
moveCursorrejectCursor
noreferrer
http://livedocs.adobe.com/flex/3/langref/mx/managers/DragManager.html
Check out the various cursor styles available on the DragManager class:
copyCursor
defaultDragImageSkin
linkCursor
moveCursor
rejectCursor
http://livedocs.adobe.com/flex/3/langref/mx/managers/DragManager.html