Flex 中的 TileListItemRenderer

发布于 2024-12-15 15:49:26 字数 850 浏览 0 评论 0原文

我按照一个示例来显示列表,代码如下...

<mx:TileList id="tileList"
                 dataProvider="{xmlListColl}"
                 itemRenderer="TileListItemRenderer"
                 columnCount="3"
                 columnWidth="150"
                 rowCount="2"
                 rowHeight="100" />

itemRenderer 是:

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
           x="496" y="10" width="221" height="317" backgroundColor="#98AEEF">

    <mx:Image source="{data.@src}"
            horizontalCenter="0"
            verticalCenter="0" />

    <mx:Label text="{data.@lbl}"
            fontWeight="bold"
            horizontalCenter="0"
            bottom="0" />

</mx:Canvas>

现在我需要帮助来启用这些图像的拖动功能。所有的拖放函数都在主 mxml 文件中...我在这里有点迷失了。需要任何其他信息请询问我。

谢谢

I followed an example to display a list and the code is as follows...

<mx:TileList id="tileList"
                 dataProvider="{xmlListColl}"
                 itemRenderer="TileListItemRenderer"
                 columnCount="3"
                 columnWidth="150"
                 rowCount="2"
                 rowHeight="100" />

The itemRenderer is:

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
           x="496" y="10" width="221" height="317" backgroundColor="#98AEEF">

    <mx:Image source="{data.@src}"
            horizontalCenter="0"
            verticalCenter="0" />

    <mx:Label text="{data.@lbl}"
            fontWeight="bold"
            horizontalCenter="0"
            bottom="0" />

</mx:Canvas>

Now I wanted help to have these images with drag enabled. All the dragDrop functions are within the main mxml file...I am a bit lost here. Any other information required please do ask me.

Thanks

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

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

发布评论

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

评论(1

趴在窗边数星星i 2024-12-22 15:49:26

您需要在 TileList 上将 DragEnabled 设置为 true。如果您只是在 TileList 内重新排列,请将其 DragMoveEnabled 和 dropEnabled 设置为 true。如果您想将其拖动到另一个列表,请在该列表上设置 dropEnabled true,但如果您想从一个列表复制到另一个列表,请参阅此处的“在复制过程中维护类型信息”http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html

如果您的目标是容器,请查看 http:// livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html

FWIW,如果您提供有关您想要做什么的更多信息,我只需要向您提供其中一条信息。您是寻求帮助的人,因此您至少应该付出与要求别人一样多的努力。

You need to set dragEnabled to true on your TileList. If you're just rearranging within the TileList, then set its dragMoveEnabled and dropEnabled to true. If you want to drag it to another List, set dropEnabled true on that list, but if you want to copy from one list to another, see "Maintaining type information during a copy" here http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html.

If your destination is a container, check out http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html .

FWIW, I would have only needed to give you one of those pieces of information if you'd given more info about what you are trying to do. You're the one seeking help, so you should put forth at least as much effort as you're asking others to.

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