How can I set a line break between two controls?
Asked
Active
Viewed 1.9k times
3

Nikolay Fominyh
- 8,946
- 8
- 66
- 102

Prasad
- 41
- 1
- 1
- 5
-
In case anyone wanted to add a "line break" **within text**, see https://stackoverflow.com/a/65767922/5846045 – Boghyon Hoffmann Feb 05 '21 at 15:43
2 Answers
6
You can use a flex box control: either <VBox>
or <HBox>
.
<VBox xmlns="sap.m" wrap="Wrap" renderType="Bare">
<!-- ... -->
</VBox>

Boghyon Hoffmann
- 17,103
- 12
- 72
- 170

suryabhan mourya
- 287
- 1
- 7
2
You don't really use linebreaks but layout controls.
If you want to have an element below another element, put both of them in a vertical layout.
https://sapui5.hana.ondemand.com/explored.html#/entity/sap.ui.layout.VerticalLayout/samples
<l:VerticalLayout>
<Input placeholder="UserID" />
<Input placeholder="Password" type="Password" />
</l:VerticalLayout>
Don't forget to include the namespace: xmlns:l="sap.ui.layout"
You can also nest different layouts: Outer layout is vertical, and each row of the vertical layout can be a horizontal layout where items are placed next to each other.
Edit: This also works in IE9. VBox
unfortunately does not work in IE9.

Marc
- 6,051
- 5
- 26
- 56