Flex / AS3拖放 - 自定义丢弃反馈 [英] Flex/AS3 Drag Drop - Custom Drop Feedback

查看:152
本文介绍了Flex / AS3拖放 - 自定义丢弃反馈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Horizo​​ntalList 组件来显示图像列表,您可以从另一个组件拖动图像以加入列表,这一切都可以正常使用。

I am using a HorizontalList component to display a list of images, you can drag images from another component to join the list, this all works fine.

如果我做 list.showDropFeedback(event)我在$ $ c $的图像顶部有一个不好看的黑色条c> Horizo​​ntalList - 我真正想要的是图像左/右的一行,新的一个将实际坐下。

If I do list.showDropFeedback(event) I get an unsightly black bar at the top of images in the HorizontalList - what I really want is a line to the left/right of the image, where the new one will actually sit.

我想我需要定义一个自定义的DropFeedback来覆盖默认值。有没有人知道有没有办法实现这一点?

I guess I need to define a custom DropFeedback to override the default. Does anyone know if there there is a way to achieve this?

谢谢!

推荐答案

Yuo可以通过覆盖showDropFeedback()方法来实现。我的代码如下:

Yuo can sove it by overriding showDropFeedback() method. My code below:

    import mx.controls.HorizontalList;
import mx.controls.listClasses.IListItemRenderer;
import mx.core.mx_internal;
import mx.events.DragEvent;

use namespace mx_internal;

public class HList extends HorizontalList
{
    public function HList()
    {
        super();                        
    }   


        override public function showDropFeedback(event:DragEvent):void
        {

           super.showDropFeedback(event);

            dropIndicator.setActualSize(rowHeight - 4, 4);
            DisplayObject(dropIndicator).rotation = 90;

        }



}

这篇关于Flex / AS3拖放 - 自定义丢弃反馈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆