Vertical Width of ButtonBar Buttons

I am creating a vertical button bar with three buttons. How to make the same width for all three buttons so that it doesn't look like shit?

<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
source share
3 answers

I had a problem too, so I dropped s: VerticalLayout and used s: TileLayout with a fixed column width and worked

<s:ButtonBar width="142" dataProvider="{almacen}" left="10" top="10">
   <s:layout>
      <s:TileLayout columnWidth="142"/>
   </s:layout>
</s:ButtonBar>
+1
source

Remember to define a space to avoid the distance between the buttons

<s:layout>
   <s:TileLayout verticalGap="-1" />
</s:layout>
0
source

, horizontalAlign .

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

, iconPlacement, ...

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

Hope this helps for dynamic text lengths ...

Happy flexibility.

0
source

Source: https://habr.com/ru/post/1741351/


All Articles