首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >有没有比sap.ui.commons.layout.MatrixLayout更好的选择呢?

有没有比sap.ui.commons.layout.MatrixLayout更好的选择呢?
EN

Stack Overflow用户
提问于 2015-11-13 00:12:05
回答 2查看 910关注 0票数 0

在开始内容固定,中心灵活,结束内容固定的情况下,最好的布局方式是什么?就像一个有三列的100%宽的HBox,第一列和最后一列是固定的,中心是伸展的?

这就是我现在所做的,我可以避免使用sap.ui.commons.layout.MatrixLayout吗?

代码语言:javascript
运行
复制
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,但它不能水平伸展:

代码语言:javascript
运行
复制
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'
        })
    ]
})
EN

Stack Overflow用户

发布于 2015-11-17 22:57:29

HBox是支持CSS3 FlexBoxLayout的浏览器的解决方案。或者,你可以嵌套两个FixFlex布局--这应该适用于所有支持ui5的浏览器(FixFlex就像是HBox/Vbox的一个特定的、有限的子集,对于非FlexBox浏览器具有后备功能)。

票数 2
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33676048

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档