What's the best way to do a layout where the start content is fixed, the center is flex and the end content is fixed? Like a 100% wide HBox with three columns, first and last col are fixed and the center stretches?
This is how I do it by now, can I avoid using sap.ui.commons.layout.MatrixLayout
?
new sap.ui.commons.layout.MatrixLayout({
layoutFixed: true,
columns: 3,
width: '100%',
widths: [ '100px', '100%', '100px' ],
rows: [
new sap.ui.commons.layout.MatrixLayoutRow({
cells : [
new sap.ui.commons.layout.MatrixLayoutCell({
content: new sap.m.Label({
text: 'start'
})
}),
new sap.ui.commons.layout.MatrixLayoutCell({
content: new sap.m.Label({
text: 'center'
})
}),
new sap.ui.commons.layout.MatrixLayoutCell({
content: new sap.m.Label({
text: 'end'
})
})
]
})
]
})
I tried to use sap.ui.layout.HorizontalLayout
, but it does not stretch horizontally:
sap.ui.layout.HorizontalLayout({
width: '100%',
content: [
new sap.m.Label({
width: '100px',
text: 'start'
}),
new sap.m.Label({
width: '100%',
text: 'center'
}),
new sap.m.Label({
width: '100px',
text: 'end'
})
]
})