首页 > 解决方案 > sap.ui.layout.form.(Simple)Form 中的进度指示器对齐问题

问题描述

ProgressIndicator应该在同一行中垂直对齐。

电流输出:
在此处输入图像描述

<form:SimpleForm id="idSimpleForm"
  editable="false"
  layout="ResponsiveGridLayout"
  maxContainerCols="2"
  columnsM="2"
  singleContainerFullSize="false"
  labelSpanS="5"
>
  <Label text="Lines Of Code"/>
  <Text text="{...}"/>
  <Label text="CSS"/>
  <ProgressIndicator percentValue="100" state="Success"/>
  <Text text="{...}"/>
  <Label text="XML"/>
  <ProgressIndicator percentValue="30" state="Success"/>
  <Text text="{...}"/>
  <Label text="JavaScript"/>
  <ProgressIndicator percentValue="20" state="Success"/>
  <Text text="{...}"/>
</form:SimpleForm>

期望的输出:
在此处输入图像描述

标签: sapui5

解决方案


只需设置displayOnlytrue.

<form:SimpleForm layout="ResponsiveGridLayout">
  <Label text="CSS"/>
  <ProgressIndicator displayOnly="true" displayValue="14k" percentValue="100" state="Information" />
  <Label text="XML"/>
  <ProgressIndicator displayOnly="true" displayValue="7.3k" percentValue="30" state="Information" />
  <Label text="JavaScript"/>
  <ProgressIndicator displayOnly="true" displayValue="2.1k" percentValue="20" state="Information" />
</form:SimpleForm>

UI5 sap.m.ProgressIndicator 与标签正确对齐 来自:https ://jsbin.com/huvokeg/edit?js,output

避免自定义 CSS。


推荐阅读