如何将 MessagePage 中的按钮图标恢复为正常大小?

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

因为我注意到我的按钮图标在其他视图中是正常大小,我猜这是因为

sap.m.MessagePage
元素。

对此是否有一个很好的解决方案,或者开发人员是否只是希望我们永远不要在该元素的按钮内使用图标? :D

globalThis.onUI5Init = () => sap.ui.require([
  "sap/ui/core/mvc/XMLView"
], async XMLView => (await XMLView.create({
  definition: document.getElementById("myxmlview").textContent,
  height: "100%",
})).placeAt("content"));
<script defer id="sap-ui-bootstrap"
  src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
  data-sap-ui-oninit="onUI5Init"
  data-sap-ui-libs="sap.ui.core,sap.m"
  data-sap-ui-theme="sap_fiori_3"
  data-sap-ui-async="true"
  data-sap-ui-compatversion="edge"
  data-sap-ui-excludejquerycompat="true"
  data-sap-ui-xx-waitfortheme="init"
></script>
<!-- Issue fully reproducible with UI5 <= 1.87 and partially reproducible until 1.93 -->
<script id="myxmlview" type="text/xml">
  <mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" displayBlock="true">
    <App>
      <MessagePage showHeader="false" icon="sap-icon://sap-ui5" text="UI5" description="sap.m.MessagePage">
        <buttons>
          <Button icon="sap-icon://message-warning" text="Change security settings" />
        </buttons>
      </MessagePage>
    </App>
  </mvc:View>
</script>
<body id="content" class="sapUiBody">
</body>

css sapui5
1个回答
2
投票

更新: 自 UI5 1.94 以来,该问题不再重现(提交:

d90fbe7
/ PR #3146)。
Update2:
sap.m.MessagePage
现已弃用
。使用
sap.m.IllustratedMessage
代替。


上一个答案:

[...] 开发人员只是希望我们永远不要在该元素的按钮内使用图标吗? :D

有点是。 :P 根据主题“按钮内容”中的 Fiori 设计指南:

一个按钮可以包含一个图标或一个文本

但是:即使没有文字,按钮图标看起来也不对:

这绝对是一个错误。刚刚在这里创建了一个问题:https://github.com/SAP/openui5/issues/3145

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