如何将“sap.suite.ui.commons.statusindicator.StatusIndicator”添加到页面?

问题描述 投票:0回答:1

我想要做的是在我的页面上添加一个状态指示器。当我运行应用程序时,我没有在控制台上收到任何错误,但状态指示器未出现在我的页面上。

这是我的页面的xml代码,

<core:View xmlns:core = "sap.ui.core" xmlns:mvc = "sap.ui.core.mvc" xmlns = "sap.m" xmlns:f = "sap.suite.ui.commons.statusindicator" controllerName = "EarthMonitoring.controller.DetailPage" xmlns:html = "http://www.w3.org/1999/xhtml">
        <Page showHeader="false">
            <content>
                <f:StatusIndicator id="statusIndicator2" width="300px" height="300px" value="90"/>
            </content>
        </Page>
</core:View>

这是结果的捕获,the image should appear on the detail page

xml sapui5
1个回答
2
投票

我想那是因为你没有指定ShapeGroupPropertyTreshold

看这个例子。希望这可以帮助。

<mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="tableSelect.controller.Main"
displayBlock="true" xmlns:si="sap.suite.ui.commons.statusindicator">
<App>
    <pages>
        <Page title="test">
            <content>
                <si:StatusIndicator id="idIndicator" value="40">
                    <si:ShapeGroup>
                        <si:Rectangle x="0" y="0" width="50" height="100" strokeWidth="1" fillingType="Linear"/>
                    </si:ShapeGroup>
                    <si:propertyThresholds>
                        <si:PropertyThreshold fillColor="Critical" toValue="60"/>
                        <si:PropertyThreshold fillColor="Error" toValue="30"/>
                        <si:PropertyThreshold fillColor="Good" toValue="100"/>
                    </si:propertyThresholds>
                </si:StatusIndicator>
            </content>
        </Page>
    </pages>
</App>

© www.soinside.com 2019 - 2024. All rights reserved.