同一 mx:Tree 控件中同级之间的垂直间隙不同

发布于 2024-09-09 06:31:48 字数 155 浏览 3 评论 0原文

有谁知道一种方法来指定树中兄弟姐妹之间的不同垂直间隙?我希望子节点的间距更紧密(可能是 10 像素),而顶层父节点的间距仍然更远(20 像素)。本质上,我需要根据节点的深度动态更改间隙,但我不确定 Tree 类(或 Tree 扩展的 List 类)是否提供这种类型的功能。有什么想法吗?提前致谢。

Does anyone know of a way to specify different vertical gaps between siblings in a Tree? I want to child nodes spaced tighter together (maybe 10px) while the top level parents remain spaced further apart (20px). Essentially, I need to change the gap dynamically based upon the depth of the node, but I'm not sure if the Tree class (or the List class, which Tree extends) offers this type of functionality. Any ideas? Thanks in advance.

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

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

发布评论

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

评论(2

一指流沙 2024-09-16 06:31:48

您可以使用 itemRenderer 并根据发送的数据向 itemRenderer 添加间距吗?

Can you use an itemRenderer and add spacing to the itemRenderer based on the data sent in?

咆哮 2024-09-16 06:31:48

我会尝试将填充设置为您想要的最小值,然后添加 以及您想要添加的任何额外高度/宽度孩子们想要的地方。

I would try setting the padding to the minimum you want, then add <mx:Spacer ... /> with whatever additional height/ width you want to add between the children where desired.

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