做一個起始內容固定,中心是彈性的,最終內容是固定的佈局的最佳方式是什麼?像三柱100%寬的HBox,第一個和最後一個孔是固定的,中心延伸?有更好的選擇sap.ui.commons.layout.MatrixLayout?
這是我現在怎麼做的,我可以避免使用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'
})
})
]
})
]
})
我試圖用sap.ui.layout.HorizontalLayout
,但它並沒有水平拉伸:
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'
})
]
})