首页 > 解决方案 > sap.ushell.ui.shell.ShellHeadItem 不显示文本

问题描述

SAPUI5 documentation他们有以下示例,用于将标题项添加到启动板顶部标题工具栏。

var oRenderer = sap.ushell.Container.getRenderer("fiori2");

    // Create an icon button that opens a dialog
    oRenderer.addHeaderEndItem({
        id: "myTestButton",
        icon: "sap-icon://action-settings",
        tooltip: resources.i18n.getText("testButton.tooltip"),
        text: resources.i18n.getText("testButton.text"),
        ariaLabel: resources.i18n.getText("testButton.ariaLabel"),
        ariaHaspopup: "dialog"
        press: [myController.handleTestButtonPress, myController]
    }, true);

    // Create a temporary link
    oRenderer.addHeaderEndItem({
        id: "myTestLink",
        ariaLabel: resources.i18n.getText("testLink.label"),
        target: "#MyTestApplication-show"
        icon: "sap-icon://overflow"
    }, true, true);

我已经测试了这个片段,不幸的是它只显示图标并且它不显示任何文本,但是工具提示有效!

任何人都知道如何强制sap.ushell.ui.shell.ShellHeadItem显示文本而不是图标!?或者至少显示图标和文本!

当我只设置文本而不设置图标属性时,它将显示以下结果:

在此处输入图像描述

标签: sapui5

解决方案


推荐阅读