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.
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.
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?
Thanks!
Thanks, this seems to rotate the dropIndicator as expected but produces other very unexpected behaviour. The horizontal scroll bar on the list suddenly disappears and dragging an item onto the list makes it skip straight to the end.... Feel's like I'm almost there, but not quite!
My AS3 code....
It looks like this is a bug in the Flex Framework:
Flex Builder 3/sdks/3.3.0/frameworks/projects/framework/src/mx/controls/HorizontalList.as
(lines 95-105)Notice that the constructor for HorizontalList is initializing the direction value to Vertical.
A quick and easy work-around is to simply specify
direction="horizontal"
in your MXML:I would be surprised if this bug hasn't already been fixed (and waiting for the next release), but I will check the Flex SDK bug database and submit a report if it's not documented.
Yuo can sove it by overriding showDropFeedback() method. My code below:
I solved this eventually by adding the following in my Application style..
And creating my custom skin..
There is a style property called dropIndicatorSkin that controls the look of the line that is shown when you drag over a list based component. From the adobe docs:
All of the functionality is built into the HorizontalList to do what you're asking, but there seems to be a bug in the HorizontalList in which it does not set its direction property to horizontal.
All you need to do is put direction="horizontal" in the mxml declaration and it will rotate the dropIndicatorSkin 90 degrees and poistion it in between the items instead of above them: