sapui5 - 如何在 XML View SAPUI5 中使用 layout.Grid?

标签 sapui5

我有那个代码。 ( https://openui5.hana.ondemand.com/#test-resources/sap/ui/layout/demokit/Grid.html )

var oGrid1 = new sap.ui.layout.Grid({
    hSpacing: 1,
    vSpacing: 1,    
    content: [
        new sap.ui.commons.TextView({
            text : 'Text spanned over 4 cols on large, 6 cols on medium, and 12 cols on small screens.',
            layoutData : new sap.ui.layout.GridData({
                span : "L4 M6 S12"
            })
        }),
        new sap.ui.commons.TextView({
            text : 'Text spanned over 4 cols on large, 6 cols on medium, and 12 cols on small screens.',
            layoutData : new sap.ui.layout.GridData({
                span : "L4 M6 S12"
            })
        }),
        new sap.ui.commons.TextView({
            text : 'Text spanned over 4 cols on large, 6 cols on medium, and 12 cols on small screens.',
            layoutData : new sap.ui.layout.GridData({
                span : "L4 M6 S12"
            })
        })
    ]
});


oGrid1.placeAt("sample1");

而且我无法理解如何在 XML 表示法中使用以下内容。
layoutData : new sap.ui.layout.GridData({span : "L4 M6 S12"})

最佳答案

SAPUI5 Diagnostics CTRL+ALT+SHIFT+S ->XML View 转换 - 一种允许您将现有 View 转换为 XML 或 HTML View 标记的实用程序

<sap.ui.commons:TextView text="Text spanned over 4 cols on large, 6 cols on medium, and 12 cols on small screens.">
    <sap.ui.commons:layoutData>
        <sap.ui.layout:GridData span="L4 M6 S12" spanL="0" spanM="0" spanS="0" indentL="0" indentM="0" indentS="0" spanLarge="0" spanMedium="0" spanSmall="0" indentLarge="0" indentMedium="0" indentSmall="0"></sap.ui.layout:GridData>
    </sap.ui.commons:layoutData>
</sap.ui.commons:TextView>

关于sapui5 - 如何在 XML View SAPUI5 中使用 layout.Grid?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23807569/

相关文章:

sapui5 - 在智能表的 P13n 对话框的过滤器选项卡中添加包含过滤选项

javascript - 单击按钮在浏览器的新选项卡中打开 sapui5 详细信息页面

sapui5 - `this.oType.formatValue` 不是一个函数

javascript - 更新 SAPUI5/OpenUI5 中的 JSON 模型

SAPUI5 如何调试负缓存错误?

javascript - 如何在sap ui5中将组合框默认值设置为登录用户ID的 session

javascript - sap.m.Table 中是否有多个标题,如 sap.ui.table.Table?

javascript - 如何在 SAPUI5 中将控件重置为其初始值?

sapui5 - 如何禁用或启用信箱并调整 UI5 以适应宽屏?

css - 如何在一行简单形式 SAPUI5 中有 4 列