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
Actionscript 3 Flex/mxml:涉及TabBar的新手布局问题_Actionscript 3_Apache Flex_Mxml - Fatal编程技术网

Actionscript 3 Flex/mxml:涉及TabBar的新手布局问题

Actionscript 3 Flex/mxml:涉及TabBar的新手布局问题,actionscript-3,apache-flex,mxml,Actionscript 3,Apache Flex,Mxml,如果运行下面的mxml代码,您将看到选项卡栏和BorderContainer之间存在间隙。如何简单地消除这一差距?我很难把它摆出来。我在选项卡栏中输入的任何内容(例如top=“10”或y=“10”)均无效 <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com

如果运行下面的mxml代码,您将看到选项卡栏和BorderContainer之间存在间隙。如何简单地消除这一差距?我很难把它摆出来。我在选项卡栏中输入的任何内容(例如top=“10”或y=“10”)均无效

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

<s:VGroup top="10" bottom="20" left="20" right="20">

    <s:Group width="100%">

        <s:HGroup left="0" top="2">
            <s:Label id="titleTextId" text="My Title" fontWeight="bold" fontSize="18"/>
        </s:HGroup>

        <s:HGroup right="0" verticalAlign="middle">
            <s:Button label="Button1" width="65"/>
            <s:Button label="Button2" width="65" />
        </s:HGroup>

    </s:Group> 

    <s:TabBar id="tabs" dataProvider="{vs}"/>

    <mx:ViewStack id="vs" height="100%" width="100%">

        <s:NavigatorContent label="Tab 1"  width="100%" height="100%">
            <s:BorderContainer width="100%" height="100%" borderWeight="1" borderStyle="solid">
                <s:Label left="3" top="5" text="This is my first tab..."/>
            </s:BorderContainer>
        </s:NavigatorContent>
        <s:NavigatorContent label="Tab 2"  width="100%" height="100%">
            <s:BorderContainer width="100%" height="100%" borderWeight="1" borderStyle="solid">
                <s:Label left="3" top="5" text="This is my second tab..."/>
            </s:BorderContainer>
        </s:NavigatorContent>

    </mx:ViewStack>
</s:VGroup> 


试试gap属性,这应该可以做到

<s:VGroup top="10" bottom="20" left="20" right="20" gap="0">


谢谢你,内特,太好了!我不知道VGroup有一个非零的默认间隙。为什么
top=
y=
不能在TabBar中工作?在选项卡栏上方添加垂直空间(除了VGroup的间隙设置)的唯一方法是在选项卡栏上方使用
吗?您想实现什么?您看到的间隙来自布局管理器,而不是组件本身-因此您必须消除布局中的间隙,而不是组件。有意义吗?抱歉,我开始了第二个问题,现在gap属性设置为0——我正在尝试在
My Title
的标签和
TabBar
组件之间添加一些垂直空间,这种方式不会影响布局的其余部分(就像VGroup的gap属性那样,因为它是在所有组件之间添加的).您可以使用间隔元素;)