在开始内容固定,中心灵活,结束内容固定的情况下,最好的布局方式是什么?就像一个有三列的100%宽的HBox,第一列和最后一列是固定的,中心是伸展的?
这就是我现在所做的,我可以避免使用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'
})
]
})
发布于 2015-11-17 22:57:29
HBox是支持CSS3 FlexBoxLayout的浏览器的解决方案。或者,你可以嵌套两个FixFlex布局--这应该适用于所有支持ui5的浏览器(FixFlex就像是HBox/Vbox的一个特定的、有限的子集,对于非FlexBox浏览器具有后备功能)。
https://stackoverflow.com/questions/33676048
复制相似问题