Flex 4.6中的Adobe Flex可折叠面板

时间:2015-08-31 13:13:33

标签: actionscript-3 flex mobile panel

我是Adobe Flex的新手,我目前正在尝试为我的移动应用程序构建一个可折叠的Panel作为侧边栏(侧边栏扩展面板)。我的问题是,我跟随的tutorial是使用Flex 4构建的,而我使用的是4.6。 但是,我没有错误,只有一个警告,告诉我“我的SidebarPanel组件的CSS Typeselector未被处理,因为该类型未在应用程序中使用。”

我尝试运行它,但我的所有Flexbuilder都显示了正常的空白面板,没有按钮,更改了skinstate。我被卡住的地方是所有标题栏图层的分组和添加按钮。我做了两个,但仍然得到了空白面板。

我将“titleBarGroup”放在教程arround“contents”,“topGroup”,“tbHilite”,“tbDiv”和“titleDisplay”以及“collapseButton”之后的“contents”-group中。

SidebarPanelSkin.mxml:

   <!-- layer 3: contents -->
<!--- Contains the vertical stack of titlebar content and controlbar. -->
<s:Group id="titleBarGroup" left="0" top="0" right="0" bottom="0"
         maxHeight="32" rotation.collapsed="90">
    <s:Group left="1" right="1" top="1" bottom="1" id="contents">
        <s:layout>
            <s:VerticalLayout gap="0" horizontalAlign="justify" />
        </s:layout>

        <!--- @private -->
        <s:Group id="topGroup" mask="{topGroupMask}">

            <!-- layer 0: title bar fill -->
            <!--- @private -->
            <s:Rect id="tbFill" left="0" right="0" top="0" bottom="1">
                <s:fill>
                    <s:LinearGradient rotation="90">
                        <s:GradientEntry color="0xE2E2E2" />
                        <s:GradientEntry color="0xD9D9D9" />
                    </s:LinearGradient>
                </s:fill>
            </s:Rect>

            <!-- layer 1: title bar highlight -->
            <!--- @private -->
            <s:Rect id="tbHilite" left="0" right="0" top="0" bottom="0">
                <s:stroke>
                    <s:LinearGradientStroke rotation="90" weight="1">
                        <s:GradientEntry color="0xEAEAEA" />
                        <s:GradientEntry color="0xD9D9D9" />
                    </s:LinearGradientStroke>
                </s:stroke>
            </s:Rect>

            <!-- layer 2: title bar divider -->
            <!--- @private -->
            <s:Rect id="tbDiv" left="0" right="0" height="1" bottom="0">
                <s:fill>
                    <s:SolidColor color="0xC0C0C0" />
                </s:fill>
            </s:Rect>

            <!-- layer 3: text -->
            <!--- @copy spark.components.Panel#titleDisplay -->
            <s:Label id="titleDisplay" maxDisplayedLines="1"
                     left="9" right="3" top="1" bottom="0" minHeight="30"
                     verticalAlign="middle" textAlign="start" fontWeight="bold">
            </s:Label>



        </s:Group>  
        <s:Button id="collapseButton" width="16" height="16" top="7" right="7"
                  label="-" label.collapsed="+" toolTip="Collapse" toolTip.collapsed="Open" />
</s:Group>

main.mxml:

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:cc="customcomp.*"
               xmlns:customskins="skins.*" applicationDPI="160" xmlns:skins="skins.*">
    <fx:Declarations>
        <!-- Platzieren Sie nichtvisuelle Elemente (z. B. Dienste, Wertobjekte) hier -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import skins.SidebarPanelSkin;
        ]]>
    </fx:Script>

    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace cc "customcomp.*";
        @namespace customskins "skins.*";

        customskins|SidebarPanel{
            skin-class: ClassReference('skins.SidebarPanelSkin');
        }

    </fx:Style>

    <cc:SidebarPanel id="collapsiblePanel" >

    </cc:SidebarPanel>

    </s:Application>

我的未处理的typeselector导致错误或我的代码中是否有其他错误?另一个问题是,是否有任何关于从Flex 4过渡到4.6的文档。找到了一些关于3到4.6的东西,但不多了。

映入眼帘,

oaten_cracker

0 个答案:

没有答案