代码之家  ›  专栏  ›  技术社区  ›  MonoThreaded

垂直按钮条形按钮宽度

  •  3
  • MonoThreaded  · 技术社区  · 16 年前

    我正在创建一个带有3个按钮的垂直按钮栏。

    <s:ButtonBar x="10" y="10" dataProvider="{viewstack1}" >
        <s:layout>
            <s:VerticalLayout gap="-1"/>
        </s:layout>
    </s:ButtonBar>
    <mx:ViewStack id="viewstack1" left="115" paddingRight="0" right="0" bottom="0" top="0">
        <s:NavigatorContent label="ABC Products" width="100%" height="100%"><custom:Banner  width="100%" height="100%"/></s:NavigatorContent>
        <s:NavigatorContent label="Btn Player" width="100%" height="100%"><custom:Player /></s:NavigatorContent>
        <s:NavigatorContent label="Btn Cleaner" width="100%" height="100%"><custom:Cleaner width="100%"/></s:NavigatorContent>
    </mx:ViewStack>
    
    3 回复  |  直到 16 年前
        1
  •  1
  •   baquiano    15 年前

    我也有这个问题,所以我放弃了s:VerticalLayout,使用了s:TileLayout和一个固定的列宽,它工作了

    <s:ButtonBar width="142" dataProvider="{almacen}" left="10" top="10">
       <s:layout>
          <s:TileLayout columnWidth="142"/>
       </s:layout>
    </s:ButtonBar>
    
        2
  •  0
  •   Aayush gEoRgE    13 年前

    记住 ,以避免

    <s:layout>
       <s:TileLayout verticalGap="-1" />
    </s:layout>
    
        3
  •  0
  •   Gowtham S    12 年前

    不必在平铺布局中强制设置宽度或设置列宽,就可以使用垂直布局的horizontalAlign属性获得相同的结果。

    <s:ButtonBar id="btnBarVertical1" dataProvider="{menuData}" requireSelection="true" labelField="label">
          <s:layout>
                <s:VerticalLayout gap="-1" horizontalAlign="justify"/>
          </s:layout>
    </s:ButtonBar>
    

    <s:ButtonBar id="btnBarVertical2" dataProvider="{menuDataWithIcon}" requireSelection="true" labelField="label" 
                    iconField="icon" iconPlacement="top">
        <s:layout>
            <s:VerticalLayout gap="-1" horizontalAlign="justify"/>
        </s:layout>
    </s:ButtonBar>
    

    我希望这将有助于动态文本长度。。。

    推荐文章