Flex 4.5 TabNavigatorcornerRadius 不起作用

发布于 2024-12-10 22:54:47 字数 1072 浏览 0 评论 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;

有什么想法为什么这行不通吗?任何易于遵循的解决方案(我是初学者)。

谢谢。

I'm having the hardest time finding a way to simply add rounded tabs to a TabNavigator control.

I have seen examples which seem to be really simple but they don't seem to work in Flex 4.5. Here is some sample code:

<?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>

and the css:

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

.tabstyle
{
corner-radius: 10;
}

I have also tried cornerRadius: 10;

Any ideas why this does not work? Any easy to follow solution (I'm a beginner).

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

诗酒趁年少 2024-12-17 22:54:47

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

You could create a skin for your app/tab navigator, use the 'create copy of' option in Flash Builder, and in the Rect section, set the radiusX, radiusY values. Then use that skin for the component

[旋木] 2024-12-17 22:54:47

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

<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>

This is the best and easiest workaround I know for this problem. It seems Adobe never solved this bug.

<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>

It's the equivalent of this but with rounded corners in the tabs (and body):

<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>
莫多说 2024-12-17 22:54:47

试试这个!

<mx:TabNavigator id="tabNavigator" tabOffset="20" cornerRadius="10" height="100%" width="100%">

Try this!

<mx:TabNavigator id="tabNavigator" tabOffset="20" cornerRadius="10" height="100%" width="100%">
仙女山的月亮 2024-12-17 22:54:47

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

        <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>

This is the sample code you can copy and run

        <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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文