Tree widgets are most often used to simulate file browsers and to visualize other hierarchical structures. Clicking the various nodes of the tree widget can show different widgets on the page or open different pages in the project.
树最常用于模拟文件浏览器并可视化其他层次结构。 单击树的各个节点可以在页面上显示不同的部件或在项目中打开不同的页面。
Adding, Deleting, and Moving Tree Nodes添加,删除和移动树节点
To add a node, right-click on an existing node and use the Add submenu. You can choose to add a child node or sibling node.要添加节点,请右键单击现有节点,然后使用添加子菜单。 你可以选择添加子节点或兄弟节点。 To move a node, right-click it and use the Move submenu. You can choose to move a node up or down or to indent or outdent it. 要移动节点,请右键单击它,然后使用移动子菜单。 你可以选择向上或向下移动节点,也可以使节点升级或降级。 To delete a node, right-click it and select Delete Node. Alternatively, select the node and press DELETE. Deleting a node will also delete its child nodes.要删除节点,请右键单击它,然后选择删除节点。 或者,选择节点并按Delete。 删除节点也将删除其子节点。 |
Note注意
A tree widget must always contain at least one node. If you attempt a deletion that would leave the widget with no nodes, you'll receive an alert stating: Cannot delete all items.树必须始终至少包含一个节点。 如果尝试删除树元件的最后一个节点,则会收到一条警告:无法删除所有节点。
The Expand/Collapse Icons展开/折叠图标
By default, each tree node with at least one child node has an icon you can click to expand and collapse its child(ren). These icons are functional on both the Axure RP canvas and in the web browser.
默认情况下,每个至少有一个子节点的树节点都有一个图标,你可以单击以展开和折叠其子节点。 这些图标在Axure RP画布和Web浏览器中均可用。
By default, the expand/collapse icons are triangles. You can select different icons by selecting the tree widget or one of its nodes and clicking Edit Tree Props in the Tree section of the Style pane. In the dialog that appears, you can choose between the two built-in options, Plus/Minus and Triangle, or you can import your own icons.
默认情况下,展开/折叠图标为三角形。 你可以通过选择树或其节点之一并在样式窗格的树部分中单击编辑树属性来选择不同的图标。 在出现的对话框中,你可以在两个内置选项(加号/减号和三角形)之间进行选择,也可以导入自己的图标。
You can also hide the expand/collapse icons by unchecking Show Expand/Collapse Icon in the Tree Properties dialog.
你还可以通过取消选中树属性对话框中的显示扩展/折叠图标来隐藏扩展/折叠图标。
Adding Icons to Tree Nodes将图标添加到树节点
In addition to the expand/collapse icons, you can also add custom static icons to the left of your tree nodes:除了展开/折叠图标之外,你还可以在树节点的左侧添加自定义静态图标:
Select the tree widget or one of its nodes and click Edit Tree Props in the Tree section of the Style pane.
In the dialog that appears, check the box for Show Icon. Then, click OK to close the dialog.
Select the tree node you want to add an icon to and click Edit Icon in the Tree section of the Style pane.
In the dialog that appears, import your icon and select where it will be shown:
This node only
This node and siblings
This node, siblings, and all child nodes
选择树或其节点之一,然后在样式窗格的树部分中单击编辑树属性。
在出现的对话框中,选中【显示图标】框。 然后,单击【确定】关闭对话框。
选择要向其添加图标的树节点,然后在样式窗格的树部分中单击编辑图标。
在出现的对话框中,导入图标并选择显示位置:
仅当前节点
当前节点和同级节点
当前节点、同级节点和全部子节点
Limitations and Workarounds局限性和解决办法
Embedding Widgets into Tree Nodes将元件嵌入到树节点
Tree nodes can only contain text and an icon; it is not possible to add widgets to a tree node. If you need additional tree contents, try building a custom tree structure with shape widgets.
树节点只能包含文本和图标。 无法将部件添加到树节点。 如果你需要其他树内容,请尝试使用形状元件构建自定义树结构。
Not Adaptive无法自适应
All aspects of tree widgets are consistent across all adaptive views. To style a tree differently across adaptive views, you can "place" a different tree widget in each adaptive view, "unplacing" from each view the tree widgets designed for other adaptive views.
树的各个方面在所有自适应视图中都是一致的。 若要在自适应视图之间对树进行样式设置,可以在每个自适应视图中放置不同的树部件,从每个视图中取消放置为其他自适应视图设计的树部件。