TabSet.setTabBarControls() - Add left aligned button and right aligned button

Hello,

how can I add a left aligned button and a right aligned button to my TabSet? By default, all added Members are aligned to the right.

I could add a nested HLayout with the Buttons in it, but this does not work since I cannot specify the size of the HLayout (if I set it to 100% width, it overlaps the Tabs of the TabSet).

Any ideas would be very much appreciated.

If what you want is that all of your custom controls appear to the right of the tabs, but some are aligned left within that space, just use a LayoutSpacer with width:“*” in between the controls that should be left-aligned vs those that should be right-aligned.

Hello Isomorphic,

thanks for your quick reply. I have followed your advice. Unfortunately, I couldn’t get it to work yet. Have a look at the attached image. The first picture is with the buttons setAutoFit to “true”. The second picture is with setAutoFit to “false”.
It seems like the LayoutSpacer does not fill the entire available space, just a part of it.

Here’s how I add the tab bar controls:

    vorgangBuchungTabSet.setTabBarControls( TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER,
        changeProjectButton, showFilterButton, buttonSpacer, buchungStartButton, buchungStopButton );

I have tried to wrap the buttons and the spacer in a HLayout. The LayoutSpacer then works like it should, but the HLayout won’t fill up the available space when I set it’s width to “*”. It is essentially the same problem.

tabs2.PNG

The gap that you’re seeing there is most likely reserved space for the scroller and picker. You could remove those from your controls array.

Unfortunately, removing these controls did not solve my problem. When I have some time to spare, I will post some test code to reproduce the problem.