SapUI5-平铺容器不起作用 [英] SapUI5- Tile container not working

查看:28
本文介绍了SapUI5-平铺容器不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,tilecontainer 无法正常工作.如果我放置一个列表而不是 Tiles ,它工作正常.我正在尝试构建一个包含磁贴的简单应用程序.我是 SAPUI5 的新手.这是XML的代码.

For some reason the tilecontainer is not working. If I place a list instead of Tiles , its working fine. I am trying to build a simple app which contains tiles. I am new to SAPUI5. This is the code of XML.

<mvc:View height="100%" controllerName="sap.ui.demo.Onepage.view.App"
xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<App>
    <Page id="" title="Tiles" class="marginBoxContent">
        <headerContent>
            <Button icon="sap-icon://filter" />
            <Button icon="sap-icon://action-settings" />
        </headerContent>
        <subHeader>
        </subHeader>
        <content>
            <TileContainer id="container" tileDelete="handleTileDelete"
                tiles="{
                        path: '/items'
                    }">
                <StandardTile icon="sap-icon://{icon}" type="{type}"
                    number="{number}" numberUnit="{numberUnit}" title="{title}" info="{info}"
                    infoState="{infoState}" />
            </TileContainer>
        </content>
        <footer>
        </footer>
    </Page>
</App>

提前致谢.

推荐答案

有时 TileContainer 可能有点棘手.您必须处理父容器中的一些属性.确保您的主页使用以下属性:

Sometimes the TileContainer can be a bit tricky. You have to take care of some attributes in the parent container. Make sure your Page uses the following attribute:

<Page enableScrolling="false">

另外一个陷阱可能是您正在使用数据绑定.只要 /items 处的模型中没有对象,就不会呈现单个图块.因此,要么确保您的模型包含 items 并将模型分配给您的视图,要么在不绑定 tiles 属性的情况下开始测试它并像这样静态地进行:

And one more pitfall could be that you´re using data binding. As long there is no object in your model at /items no single tile will be rendered. So either make sure that your model contains items and the model is assigned to your view or start testing it without binding the tiles property and do it static like this:

<mvc:View height="100%" controllerName="sap.ui.demo.Onepage.view.App"
xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<App>
    <Page id="" title="Tiles" class="marginBoxContent"
        enableScrolling="false">
        <headerContent>
            <Button icon="sap-icon://filter" />
            <Button icon="sap-icon://action-settings" />
        </headerContent>
        <subHeader>
        </subHeader>
        <content>
            <TileContainer id="container" tileDelete="handleTileDelete">
                <StandardTile icon="sap-icon://temperature" type="None"
                    number="23°" numberUnit="Celcius" title="Walldorf" info="Cloudy" />
            </TileContainer>
        </content>
        <footer>
        </footer>
    </Page>
</App>

这篇关于SapUI5-平铺容器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆