做一个起始内容固定,中心是弹性的,最终内容是固定的布局的最佳方式是什么?像三柱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'
})
]
})