Flex小技巧: 设定Visiable = flase后重新排列UI

初始化完成后:

点击左侧目录后:

 

具体实现:

初始化时:

//Main – Maincontent
vboxMainRightcontent = new VBox();
empListContainer = new MainContent();
empListContainer.visible = false;
vboxMainRightcontent.addChild(empListContainer);
//—————————-加入button 测试 invilidate…———-
testButton.label = "我是来测试的";
vboxMainRightcontent.addChild(testButton);
empListContainer.explicitHeight = 0;//注意此处, 设置为0方可不占用界面中的场地, 注意在visable设置为true之后还要进行相应的调整
empListContainer.explicitWidth = 0;

左侧目录被点击后:

//———————————Listeners————————
//Listener – onListChange
private function onDepListChange(e:ListEvent):void {
_empListContainer.visible = _treeDepCat.selectedItem != null;

if(_empListContainer.visible) {
_empListContainer.explicitHeight = undefined;//将explicitHeight复原, 否则虽然已经visable, 但其宽高都是0 仍无法可见.
_empListContainer.explicitWidth = [...]

文件属性设置UI设计 – 初探Flex中自定义组件 Custom UI Component Example: Unix File Permission Setting

[小站博客均为原创, 转载请保留以下信息:

作者:http://liguoliang.com 欢迎访问:Adobe上海用户组: http://riashanghai.com ]

一:目标

设计一个自定义组件,可以通过该UI初步读取或设置文件属性.