我想做的是在页面上添加一个状态指示器。运行该应用程序时,控制台上没有出现任何错误,但是状态指示器没有出现在我的页面上。
这是我页面的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>
答案 0 :(得分:2)
我认为这是因为您未能指定ShapeGroup
和PropertyTreshold
。
请参阅此示例。希望这会有所帮助。
<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>