Flex中如何利用backgroundDisabledColor和disabledOverlayAlpha样式,在一个容器的enabled属性为false时添加一个覆盖层

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
        layout="vertical" 
        verticalAlign="middle" 
        backgroundColor="white" 
        creationComplete="init();"> 
 
    <mx:Script> 
        <![CDATA[ 
            private function init():void { 
                var col:uint = panel.getStyle("backgroundColor"); 
                colorPicker.selectedColor = col; 
            } 
        ]]> 
    </mx:Script> 
 
    <mx:ApplicationControlBar dock="true"> 
        <mx:CheckBox id="checkBox" 
                label="enabled" 
                selected="true" /> 
 
        <mx:Spacer width="50%" /> 
 
        <mx:Label text="backgroundDisabledColor:" /> 
        <mx:ColorPicker id="colorPicker" /> 
 
        <mx:Spacer width="50%" /> 
 
        <mx:Label text="disabledOverlayAlpha:" /> 
        <mx:HSlider id="slider" 
                minimum="0" 
                maximum="1" 
                value="0.6" 
                liveDragging="true" 
                tickInterval="0.1" 
                showTrackHighlight="true" /> 
    </mx:ApplicationControlBar> 
 
    <mx:Panel id="panel" 
            title="Panel title" 
            status="Panel status" 
            enabled="{checkBox.selected}" 
            backgroundColor="red" 
            backgroundDisabledColor="{colorPicker.selectedColor}" 
            disabledOverlayAlpha="{slider.value}"> 
        <mx:Form> 
            <mx:FormHeading label="LOGIN" /> 
            <mx:FormItem label="Username:"> 
                <mx:TextInput id="userame" /> 
            </mx:FormItem> 
            <mx:FormItem label="Password:"> 
                <mx:TextInput id="password" 
                        displayAsPassword="true" /> 
            </mx:FormItem> 
            <mx:FormItem> 
                <mx:Button label="Login" /> 
            </mx:FormItem> 
        </mx:Form> 
    </mx:Panel> 
 
</mx:Application>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值