move
移动树节点
说明
move(
将目标节点移动到指定的同级节点之后。targetnode
,siblingnode
)
move(
将目标节点移动到指定的同级节点之后或之前。将位置指定为 targetnode
,siblingnode
,location
)'after'
或 'before'
。
示例
更改两个节点的顺序
创建包含两个顶层节点的树,每个顶层节点包含一个子节点。
fig = uifigure; tree = uitree(fig,'Position',[20 20 200 150]); node1 = uitreenode(tree,'Text','Runners'); node2 = uitreenode(tree,'Text','Cyclists'); runner = uitreenode(node1,'Text','Joe'); cyclist = uitreenode(node2,'Text','Rajeev');
将 Cyclists 移动到 Runners 之前。
move(node2,node1,'before');
将 Cyclists 移动到 Runners 之后。因为 location
的默认值为 'after'
,所以可以省略该参量。
move(node2,node1);
输入参数
targetnode
— 目标节点
TreeNode
对象
目标节点,指定为 TreeNode
对象。
siblingnode
— 同级节点
TreeNode
对象
同级节点,指定为 TreeNode
对象。
location
— 目标位置
'after'
(默认) | 'before'
目标位置,指定为 'after'
或 'before'
。
版本历史记录
在 R2017b 中推出
另请参阅
uitree
| uitreenode
| expand
| collapse
| scroll
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)