首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在XML view SAPUI5中使用layout.Grid?

如何在XML view SAPUI5中使用layout.Grid?
EN

Stack Overflow用户
提问于 2014-05-22 21:00:32
回答 1查看 14.3K关注 0票数 6

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

代码语言:javascript
复制
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表示法中使用下面的内容。

代码语言:javascript
复制
layoutData : new sap.ui.layout.GridData({span : "L4 M6 S12"})
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-22 21:29:58

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

代码语言:javascript
复制
<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>
票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23807569

复制
相关文章

相似问题

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