Flex 中的 TileListItemRenderer
我按照一个示例来显示列表,代码如下...
<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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在 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.