3

As the Title states.

My attempt:

<VBox>  
    <HBox alignItems="Right" id="Tabelle">
        <Button visible="true" enabled="true" icon="sap-icon://navigation-right-arrow" />
        <Button visible="true" enabled="true" icon="sap-icon://open-command-field" />
        <Button visible="true" enabled="true" icon="sap-icon://process" />
    </HBox>
</VBox>

Adding an alignItems -> to the Right so the Elements of Hbox will be put on the Right side of VBox but it seem not to work.

Why is not working?

Inizio
  • 2,226
  • 15
  • 18
Roman_Mr1112
  • 53
  • 2
  • 12

3 Answers3

4

The best control I can suggest it FlexBox

<FlexBox
    alignItems="Center"
    justifyContent="End">
    <items>
        <Button enabled="true" icon="sap-icon://navigation-right-arrow" class="sapUiSmallMarginEnd"/>
        <Button enabled="true" icon="sap-icon://open-command-field" class="sapUiSmallMarginEnd"/>
        <Button enabled="true" icon="sap-icon://process" />
    </items>
</FlexBox>

Output

enter image description here

Inizio
  • 2,226
  • 15
  • 18
4

HBox (and VBox) is basically a Flexbox, to put the content to the right use justifyContent not alignContent nor alignItems.

<HBox justifyContent="End" id="Tabelle">
    <Button visible="true" enabled="true" icon="sap-icon://navigation-right-arrow" />
    <Button visible="true" enabled="true" icon="sap-icon://open-command-field" />
    <Button visible="true" enabled="true" icon="sap-icon://process" />
</HBox>

Example

Good reference for flexbox positioning: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Edit 1: Added Example Edit 2: Grammar & Typos

Lumpenstein
  • 1,250
  • 1
  • 10
  • 27
1

Try with alignContent instead of alignItems OR combination of both. It seems that both have some impact.

You can check the HBox API documentation as well

Inizio
  • 2,226
  • 15
  • 18