论坛首页 编程语言技术论坛

Flex中真正隐藏控件

浏览 5099 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-10-29  
<xml version=”1.0″ encoding=”utf-8″?>
<mx:Application
xmlns:mx=”http://www.adobe.com/2006/mxml”
layout=”vertical”>
<mx:Button label=”hide text”
click=”myText.visible=false;
myText.includeInLayout=false;” />
<mx:Text id=”myText” text=”hello,
this text will be hidden or shown,
depending on the buttons” />
<mx:Button label=”show text”
click=”myText.visible=true;
myText.includeInLayout=true;” />
</mx:Application>



通常大家都会设置visible属性为false。但这样做还是会有问题:组件仍然占用原来的位置。
最后同时使用includeInLayout与visible属性来解决。
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics