Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 为什么ActionBar图标上有Alpha?_Apache Flex_Mobile_Flex4_Flex4.5 - Fatal编程技术网

Apache flex 为什么ActionBar图标上有Alpha?

Apache flex 为什么ActionBar图标上有Alpha?,apache-flex,mobile,flex4,flex4.5,Apache Flex,Mobile,Flex4,Flex4.5,我正试图通过创建自定义按钮栏皮肤来设置我的TabbedViewNavigator选项卡栏的样式。这是我的纽扣皮肤代码: <?xml version="1.0" encoding="utf-8"?> <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fb="http://ns.adobe.com/flashbuilde

我正试图通过创建自定义按钮栏皮肤来设置我的TabbedViewNavigator选项卡栏的样式。这是我的纽扣皮肤代码:

 <?xml version="1.0" encoding="utf-8"?>

 <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:fb="http://ns.adobe.com/flashbuilder/2009">

<fx:Metadata>[HostComponent("spark.components.ButtonBar")]</fx:Metadata> 
<fx:Script fb:purpose="styling">
    <![CDATA[
        import mx.core.IFlexDisplayObject;
        import mx.core.ILayoutElement;
        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
        {
            super.updateDisplayList(unscaledWidth, unscaledHeight);
            layoutContents(unscaledWidth, unscaledHeight);
        }
        protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
        {
            setElementPosition(scroller, 0, 0);
            setElementSize(scroller, unscaledWidth, unscaledHeight);
            var backgroundAlphaValue:* = getStyle("backgroundAlpha");
            var backgroundAlpha:Number = (backgroundAlphaValue === undefined)
                ? 1 : getStyle("backgroundAlpha");

            graphics.beginFill(getStyle("chromeColor"), backgroundAlpha);
            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
            graphics.endFill();
        }

        protected function setElementPosition(element:Object, x:Number, y:Number):void
        {
            if (element is ILayoutElement)
            {
                ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
            }
            else if (element is IFlexDisplayObject)
            {
                IFlexDisplayObject(element).move(x, y);   
            }
            else
            {
                element.x = x;
                element.y = y;
            }
        }
        protected function setElementSize(element:Object, width:Number, height:Number):void
        {
            if (element is ILayoutElement)
            {
                ILayoutElement(element).setLayoutBoundsSize(width, height, false);
            }
            else if (element is IFlexDisplayObject)
            {
                IFlexDisplayObject(element).setActualSize(width, height);
            }
            else
            {
                element.width = width;
                element.height = height;
            }
        }
    ]]>
</fx:Script>

<s:states>
    <s:State name="normal" />
    <s:State name="disabled" />
</s:states>

<fx:Declarations>
    <!--- 
        @copy spark.components.ButtonBar#firstButton
        @default spark.skins.spark.ButtonBarFirstButtonSkin
        @see spark.skins.spark.ButtonBarFirstButtonSkin
    -->
    <fx:Component id="firstButton">
        <s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarFirstButtonSkin" /><!--css.nxInspect.mobile.redCss.skins.nxButtonBarSkin.ButtonBarFirstButtonSkin-->
    </fx:Component>

    <!--- 
        @copy spark.components.ButtonBar#middleButton
        @default spark.skins.spark.ButtonBarMiddleButtonSkin
        @see spark.skins.spark.ButtonBarMiddleButtonSkin
    -->
    <fx:Component id="middleButton" >
        <s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarMiddleButtonSkin" /><!-- css.nxInspect.mobile.redCss.skins.nxButtonBarSkin.ButtonBarMiddleButtonSkin-->
    </fx:Component>

    <!--- 
        @copy spark.components.ButtonBar#lastButton
        @default spark.skins.spark.ButtonBarLastButtonSkin
        @see spark.skins.spark.ButtonBarLastButtonSkin
    -->
    <fx:Component id="lastButton" >
        <s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarLastButtonSkin" /><!--css.nxInspect.mobile.redCss.skins.nxButtonBarSkin.ButtonBarLastButtonSkin-->
    </fx:Component>

</fx:Declarations>

<!--- @copy spark.components.SkinnableDataContainer#dataGroup -->
<s:Scroller id="scroller"  interactionMode="touch"
    skinClass="css.nxInspect.mobile.blackgoldCss.skins.nxScrollerTabBarSkin.ScrollerTabBarSkin">
    <s:DataGroup id="dataGroup" width="100%" height="100%">
        <s:layout>
            <!--<s:ButtonBarHorizontalLayout gap="-1"/>-->
            <s:HorizontalLayout useVirtualLayout="false" gap="0" variableColumnWidth="false"
                                columnWidth="400" verticalAlign="justify"/>
        </s:layout>
    </s:DataGroup>  
</s:Scroller>

[主机组件(“spark.components.ButtonBar”)]

我不明白为什么按钮图标有alpha!:

好的

我做了我自己的纽扣扣皮,并补充道

 static private const exclusions:Array = ["labelDisplay",'iconDisplay'];
有了这个,我成功地为我的图标找到了正确的颜色