0

我很难找到一种方法来简单地将圆形标签添加到 TabNavigator 控件。

我看到的例子看起来很简单,但它们似乎在 Flex 4.5 中不起作用。这是一些示例代码:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955"     minHeight="600">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Style source="style.css"/>

<mx:TabNavigator x="93" y="90" width="571" height="293" tabStyleName="tabstyle">
    <s:NavigatorContent width="100%" height="100%" label="Tab 1">
    </s:NavigatorContent>
</mx:TabNavigator>
</s:Application>

和CSS:

/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";

.tabstyle
{
corner-radius: 10;
}

我也试过cornerRadius:10;

任何想法为什么这不起作用?任何易于遵循的解决方案(我是初学者)。

谢谢。

4

4 回答 4

0

这是我所知道的解决此问题的最佳和最简单的解决方法。似乎 Adob​​e 从未解决过这个错误。

<s:VGroup width="100%" height="100%" gap="0" >
    <s:Group width="100%">
        <s:TabBar left="4" dataProvider="{tabNav}" cornerRadius="4" />
    </s:Group>
    <s:BorderContainer width="100%" height="100%" cornerRadius="4">
        <mx:ViewStack id="tabNav" paddingBottom="10" width="100%" height="100%" >
            <s:NavigatorContent label="Form" width="100%" height="100%">
                ...
            </s:NavigatorContent>
            <mx:Canvas id="treeNode" label="TreeNodeComponent" width="100%" height="100%">
                ...
            </mx:Canvas>
            <mx:Canvas id="melding" label="Melding" width="100%" height="100%" visible="{authorisation.moduleHasUserAutorization('melding')}" includeInLayout="{melding.visible}">
                ...
            </mx:Canvas>
        </mx:ViewStack>
    </s:BorderContainer>
</s:VGroup>

它与此等效,但在选项卡(和正文)中有圆角:

<mx:TabNavigator id="tabNav" paddingBottom="10" width="100%" height="100%" >
    <s:NavigatorContent label="Form" width="100%" height="100%">
        ...
    </s:NavigatorContent>
    <mx:Canvas id="treeNode" label="TreeNodeComponent" width="100%" height="100%">
        ...
    </mx:Canvas>
    <mx:Canvas id="melding" label="Melding" width="100%" height="100%" visible="{authorisation.moduleHasUserAutorization('melding')}" includeInLayout="{melding.visible}">
        ...
    </mx:Canvas>
</mx:TabNavigator>
于 2012-09-07T09:08:08.993 回答
0

您可以为您的应用程序/选项卡导航器创建一个皮肤,使用 Flash Builder 中的“创建副本”选项,然后在“矩形”部分中,设置 radiusX、radiusY 值。然后将该皮肤用于组件

于 2011-10-20T09:08:39.707 回答
-1

这是您可以复制并运行的示例代码

        <s:NavigatorContent id="search" label="Search"  width="100%" height="100%" fontWeight="bold" 
                            >

            <s:layout>

                <s:VerticalLayout horizontalAlign="center"  
                                  paddingTop="5" paddingLeft="5" 
                                  paddingRight="5" paddingBottom="5" />
            </s:layout>

            <s:Label text="Search Panel" />
            <s:HGroup >
                <s:TextInput id="Searchtxt" width="200" />
                <mx:Button label="search" click="Searchtxt.text=''" />
            </s:HGroup>
        </s:NavigatorContent>

        <s:NavigatorContent id="custInfo" label="Customer Info" backgroundColor="0xDCDCDC" 
                            width="100%" height="100%" fontWeight="bold" >

            <s:layout>
                <s:VerticalLayout horizontalAlign="center"  
                                  paddingTop="5" paddingLeft="5" 
                                  paddingRight="5" paddingBottom="5" />
            </s:layout>

            <s:Label text="Customer Info" />
            <s:HGroup>
                <s:Label text="Email Address"/>
                <s:TextInput id="email" width="200"/>
                <s:Button label="Submit" click="email.text='';" />
            </s:HGroup>
        </s:NavigatorContent>

        <s:NavigatorContent id="accountInfo" label="Account Info" backgroundColor="0xDCDCDC" width="100%" height="100%" fontWeight="bold" >

            <s:layout>
                <s:VerticalLayout horizontalAlign="center"  
                                  paddingTop="5" paddingLeft="5" 
                                  paddingRight="5" paddingBottom="5" />
            </s:layout>

            <s:Label text="Account Info" />
            <s:HGroup>
                <s:Button label="Purchases" />
                <s:Button label="Sales" />
                <s:Button label="Reports" />
            </s:HGroup>
        </s:NavigatorContent>

    </mx:ViewStack>
于 2012-07-08T02:41:20.737 回答
-1

尝试这个!

<mx:TabNavigator id="tabNavigator" tabOffset="20" cornerRadius="10" height="100%" width="100%">
于 2011-10-20T02:05:53.757 回答